1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32I-FPELIM %s
4 ; RUN: llc -mtriple=riscv32 -frame-pointer=all -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV32I-WITHFP %s
7 %struct.key_t = type { i32, [16 x i8] }
9 define i32 @test() nounwind {
10 ; RV32I-FPELIM-LABEL: test:
11 ; RV32I-FPELIM: # %bb.0:
12 ; RV32I-FPELIM-NEXT: addi sp, sp, -32
13 ; RV32I-FPELIM-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
14 ; RV32I-FPELIM-NEXT: sw zero, 24(sp)
15 ; RV32I-FPELIM-NEXT: sw zero, 8(sp)
16 ; RV32I-FPELIM-NEXT: sw zero, 12(sp)
17 ; RV32I-FPELIM-NEXT: sw zero, 16(sp)
18 ; RV32I-FPELIM-NEXT: sw zero, 20(sp)
19 ; RV32I-FPELIM-NEXT: addi a0, sp, 12
20 ; RV32I-FPELIM-NEXT: call test1
21 ; RV32I-FPELIM-NEXT: li a0, 0
22 ; RV32I-FPELIM-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
23 ; RV32I-FPELIM-NEXT: addi sp, sp, 32
24 ; RV32I-FPELIM-NEXT: ret
26 ; RV32I-WITHFP-LABEL: test:
27 ; RV32I-WITHFP: # %bb.0:
28 ; RV32I-WITHFP-NEXT: addi sp, sp, -32
29 ; RV32I-WITHFP-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
30 ; RV32I-WITHFP-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
31 ; RV32I-WITHFP-NEXT: addi s0, sp, 32
32 ; RV32I-WITHFP-NEXT: sw zero, -16(s0)
33 ; RV32I-WITHFP-NEXT: sw zero, -32(s0)
34 ; RV32I-WITHFP-NEXT: sw zero, -28(s0)
35 ; RV32I-WITHFP-NEXT: sw zero, -24(s0)
36 ; RV32I-WITHFP-NEXT: sw zero, -20(s0)
37 ; RV32I-WITHFP-NEXT: addi a0, s0, -28
38 ; RV32I-WITHFP-NEXT: call test1
39 ; RV32I-WITHFP-NEXT: li a0, 0
40 ; RV32I-WITHFP-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
41 ; RV32I-WITHFP-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
42 ; RV32I-WITHFP-NEXT: addi sp, sp, 32
43 ; RV32I-WITHFP-NEXT: ret
44 %key = alloca %struct.key_t, align 8
45 call void @llvm.memset.p0.i64(ptr align 4 %key, i8 0, i64 20, i1 false)
46 %1 = getelementptr inbounds %struct.key_t, ptr %key, i64 0, i32 1, i64 0
47 call void @test1(ptr %1)
51 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1)
53 declare void @test1(ptr)