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.p0.i32(ptr, 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: sw $4, 8($fp) # 4-byte Folded Spill
19 ; MIPS32-NEXT: move $6, $5
20 ; MIPS32-NEXT: lw $5, 8($fp) # 4-byte Folded Reload
21 ; MIPS32-NEXT: sw $6, 12($fp) # 4-byte Folded Spill
22 ; MIPS32-NEXT: ori $2, $zero, 1
23 ; MIPS32-NEXT: ori $1, $zero, 0
24 ; MIPS32-NEXT: sw $1, 16($fp) # 4-byte Folded Spill
25 ; MIPS32-NEXT: addiu $1, $6, 1
26 ; MIPS32-NEXT: mul $1, $1, $2
27 ; MIPS32-NEXT: addiu $1, $1, 7
28 ; MIPS32-NEXT: addiu $2, $zero, 65528
29 ; MIPS32-NEXT: and $2, $1, $2
30 ; MIPS32-NEXT: move $1, $sp
31 ; MIPS32-NEXT: subu $4, $1, $2
32 ; MIPS32-NEXT: sw $4, 20($fp) # 4-byte Folded Spill
33 ; MIPS32-NEXT: move $sp, $4
34 ; MIPS32-NEXT: addiu $sp, $sp, -16
35 ; MIPS32-NEXT: jal memset
37 ; MIPS32-NEXT: lw $5, 12($fp) # 4-byte Folded Reload
38 ; MIPS32-NEXT: lw $1, 16($fp) # 4-byte Folded Reload
39 ; MIPS32-NEXT: lw $4, 20($fp) # 4-byte Folded Reload
40 ; MIPS32-NEXT: addiu $sp, $sp, 16
41 ; MIPS32-NEXT: addu $2, $4, $5
42 ; MIPS32-NEXT: sb $1, 0($2)
43 ; MIPS32-NEXT: addiu $sp, $sp, -16
44 ; MIPS32-NEXT: jal puts
46 ; MIPS32-NEXT: addiu $sp, $sp, 16
47 ; MIPS32-NEXT: move $sp, $fp
48 ; MIPS32-NEXT: lw $fp, 24($sp) # 4-byte Folded Reload
49 ; MIPS32-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload
50 ; MIPS32-NEXT: addiu $sp, $sp, 32
55 %vla = alloca i8, i32 %add, align 1
56 call void @llvm.memset.p0.i32(ptr align 1 %vla, i8 %c, i32 %N, i1 false)
57 %arrayidx = getelementptr inbounds i8, ptr %vla, i32 %N
58 store i8 0, ptr %arrayidx, align 1
59 %call = call i32 @puts(ptr %vla)