1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=riscv32 -mattr=+f,+zcmp -target-abi ilp32f -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+f,+zcmp -target-abi lp64f -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV64
7 ; Test the file could be compiled successfully.
8 ; .cfi_offset of fs0 is wrong here. It should be fixed by #66613.
9 define float @foo(float %arg) {
11 ; RV32: # %bb.0: # %entry
12 ; RV32-NEXT: cm.push {ra}, -32
13 ; RV32-NEXT: .cfi_def_cfa_offset 32
14 ; RV32-NEXT: fsw fs0, 12(sp) # 4-byte Folded Spill
15 ; RV32-NEXT: .cfi_offset ra, -4
16 ; RV32-NEXT: .cfi_offset fs0, -20
17 ; RV32-NEXT: fmv.s fs0, fa0
18 ; RV32-NEXT: call callee
19 ; RV32-NEXT: fmv.s fa0, fs0
20 ; RV32-NEXT: flw fs0, 12(sp) # 4-byte Folded Reload
21 ; RV32-NEXT: cm.popret {ra}, 32
24 ; RV64: # %bb.0: # %entry
25 ; RV64-NEXT: cm.push {ra}, -32
26 ; RV64-NEXT: .cfi_def_cfa_offset 32
27 ; RV64-NEXT: fsw fs0, 12(sp) # 4-byte Folded Spill
28 ; RV64-NEXT: .cfi_offset ra, -8
29 ; RV64-NEXT: .cfi_offset fs0, -20
30 ; RV64-NEXT: fmv.s fs0, fa0
31 ; RV64-NEXT: call callee
32 ; RV64-NEXT: fmv.s fa0, fs0
33 ; RV64-NEXT: flw fs0, 12(sp) # 4-byte Folded Reload
34 ; RV64-NEXT: cm.popret {ra}, 32
40 define void @foo2(i32 %x, float %y) {
42 ; RV32: # %bb.0: # %entry
43 ; RV32-NEXT: cm.push {ra, s0}, -32
44 ; RV32-NEXT: .cfi_def_cfa_offset 32
45 ; RV32-NEXT: fsw fs0, 12(sp) # 4-byte Folded Spill
46 ; RV32-NEXT: .cfi_offset ra, -8
47 ; RV32-NEXT: .cfi_offset s0, -4
48 ; RV32-NEXT: .cfi_offset fs0, -20
49 ; RV32-NEXT: fmv.s fs0, fa0
50 ; RV32-NEXT: mv s0, a0
52 ; RV32-NEXT: mv a0, s0
53 ; RV32-NEXT: fmv.s fa0, fs0
54 ; RV32-NEXT: flw fs0, 12(sp) # 4-byte Folded Reload
55 ; RV32-NEXT: cm.pop {ra, s0}, 32
56 ; RV32-NEXT: tail func
59 ; RV64: # %bb.0: # %entry
60 ; RV64-NEXT: cm.push {ra, s0}, -32
61 ; RV64-NEXT: .cfi_def_cfa_offset 32
62 ; RV64-NEXT: fsw fs0, 12(sp) # 4-byte Folded Spill
63 ; RV64-NEXT: .cfi_offset ra, -16
64 ; RV64-NEXT: .cfi_offset s0, -8
65 ; RV64-NEXT: .cfi_offset fs0, -20
66 ; RV64-NEXT: fmv.s fs0, fa0
67 ; RV64-NEXT: mv s0, a0
69 ; RV64-NEXT: mv a0, s0
70 ; RV64-NEXT: fmv.s fa0, fs0
71 ; RV64-NEXT: flw fs0, 12(sp) # 4-byte Folded Reload
72 ; RV64-NEXT: cm.pop {ra, s0}, 32
73 ; RV64-NEXT: tail func
76 tail call void @func(i32 %x, float %y)
81 declare void @func(i32, float)