1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32
5 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i1)
7 define void @Print_c_N_times(i8 %c, i32 %N) {
8 ; MIPS32-LABEL: Print_c_N_times:
9 ; MIPS32: # %bb.0: # %entry
10 ; MIPS32-NEXT: addiu $sp, $sp, -32
11 ; MIPS32-NEXT: .cfi_def_cfa_offset 32
12 ; MIPS32-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill
13 ; MIPS32-NEXT: sw $fp, 24($sp) # 4-byte Folded Spill
14 ; MIPS32-NEXT: .cfi_offset 31, -4
15 ; MIPS32-NEXT: .cfi_offset 30, -8
16 ; MIPS32-NEXT: move $fp, $sp
17 ; MIPS32-NEXT: .cfi_def_cfa_register 30
18 ; MIPS32-NEXT: ori $1, $zero, 1
19 ; MIPS32-NEXT: ori $2, $zero, 0
20 ; MIPS32-NEXT: addu $3, $5, $1
21 ; MIPS32-NEXT: mul $1, $3, $1
22 ; MIPS32-NEXT: ori $3, $zero, 7
23 ; MIPS32-NEXT: addu $1, $1, $3
24 ; MIPS32-NEXT: addiu $3, $zero, 65528
25 ; MIPS32-NEXT: and $1, $1, $3
26 ; MIPS32-NEXT: move $3, $sp
27 ; MIPS32-NEXT: subu $1, $3, $1
28 ; MIPS32-NEXT: move $sp, $1
29 ; MIPS32-NEXT: addiu $sp, $sp, -16
30 ; MIPS32-NEXT: sw $4, 20($fp) # 4-byte Folded Spill
31 ; MIPS32-NEXT: move $4, $1
32 ; MIPS32-NEXT: lw $3, 20($fp) # 4-byte Folded Reload
33 ; MIPS32-NEXT: sw $5, 16($fp) # 4-byte Folded Spill
34 ; MIPS32-NEXT: move $5, $3
35 ; MIPS32-NEXT: lw $6, 16($fp) # 4-byte Folded Reload
36 ; MIPS32-NEXT: sw $2, 12($fp) # 4-byte Folded Spill
37 ; MIPS32-NEXT: sw $1, 8($fp) # 4-byte Folded Spill
38 ; MIPS32-NEXT: jal memset
40 ; MIPS32-NEXT: addiu $sp, $sp, 16
41 ; MIPS32-NEXT: lw $1, 8($fp) # 4-byte Folded Reload
42 ; MIPS32-NEXT: lw $2, 16($fp) # 4-byte Folded Reload
43 ; MIPS32-NEXT: addu $3, $1, $2
44 ; MIPS32-NEXT: lw $4, 12($fp) # 4-byte Folded Reload
45 ; MIPS32-NEXT: sb $4, 0($3)
46 ; MIPS32-NEXT: addiu $sp, $sp, -16
47 ; MIPS32-NEXT: move $4, $1
48 ; MIPS32-NEXT: jal puts
50 ; MIPS32-NEXT: addiu $sp, $sp, 16
51 ; MIPS32-NEXT: move $sp, $fp
52 ; MIPS32-NEXT: lw $fp, 24($sp) # 4-byte Folded Reload
53 ; MIPS32-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload
54 ; MIPS32-NEXT: addiu $sp, $sp, 32
59 %vla = alloca i8, i32 %add, align 1
60 call void @llvm.memset.p0i8.i32(i8* align 1 %vla, i8 %c, i32 %N, i1 false)
61 %arrayidx = getelementptr inbounds i8, i8* %vla, i32 %N
62 store i8 0, i8* %arrayidx, align 1
63 %call = call i32 @puts(i8* %vla)