1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=riscv32 | FileCheck %s
4 define i32 @get_stack() nounwind {
5 ; CHECK-LABEL: get_stack:
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: mv a0, sp
10 %sp = call i32 @llvm.read_register.i32(metadata !0)
14 define void @set_stack(i32 %val) nounwind {
15 ; CHECK-LABEL: set_stack:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: mv sp, a0
20 call void @llvm.write_register.i32(metadata !0, i32 %val)
24 define i32 @get_tp_arch_name() nounwind {
25 ; CHECK-LABEL: get_tp_arch_name:
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: mv a0, tp
30 %sp = call i32 @llvm.read_register.i32(metadata !1)
34 define i32 @get_csr_vlenb() nounwind {
35 ; CHECK-LABEL: get_csr_vlenb:
36 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: csrr a0, vlenb
40 %sp = call i32 @llvm.read_register.i32(metadata !2)
45 declare i32 @llvm.read_register.i32(metadata) nounwind
46 declare void @llvm.write_register.i32(metadata, i32) nounwind