1 ; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s
3 define i32 @twoalloca(i32 %size) nounwind {
5 ; CHECK: subu $[[T0:[0-9]+]], $sp, $[[SZ:[0-9]+]]
6 ; CHECK: move $sp, $[[T0]]
7 ; CHECK: subu $[[T2:[0-9]+]], $sp, $[[SZ]]
8 ; CHECK: move $sp, $[[T2]]
9 ; CHECK: move $4, $[[T0]]
10 ; CHECK: move $4, $[[T2]]
11 %tmp1 = alloca i8, i32 %size, align 4
12 %add.ptr = getelementptr inbounds i8, ptr %tmp1, i32 5
13 store i8 97, ptr %add.ptr, align 1
14 %tmp4 = alloca i8, i32 %size, align 4
15 call void @foo2(double 1.000000e+00, double 2.000000e+00, i32 3) nounwind
16 %call = call i32 @foo(ptr %tmp1) nounwind
17 %call7 = call i32 @foo(ptr %tmp4) nounwind
18 %add = add nsw i32 %call7, %call
22 declare void @foo2(double, double, i32)
26 @.str = private unnamed_addr constant [22 x i8] c"%d %d %d %d %d %d %d\0A\00", align 1
28 define i32 @alloca2(i32 %size) nounwind {
31 ; CHECK: subu $[[T0:[0-9]+]], $sp
32 ; CHECK: move $sp, $[[T0]]
34 %tmp1 = alloca i8, i32 %size, align 4
35 %cmp = icmp sgt i32 %size, 10
36 br i1 %cmp, label %if.then, label %if.else
38 if.then: ; preds = %entry
39 ; CHECK: addiu $4, $[[T0]], 40
41 %add.ptr = getelementptr inbounds i8, ptr %tmp1, i32 40
42 call void @foo3(ptr %add.ptr) nounwind
43 %arrayidx15.pre = getelementptr inbounds i8, ptr %tmp1, i32 12
46 if.else: ; preds = %entry
47 ; CHECK: addiu $4, $[[T0]], 12
49 %add.ptr5 = getelementptr inbounds i8, ptr %tmp1, i32 12
50 call void @foo3(ptr %add.ptr5) nounwind
53 if.end: ; preds = %if.else, %if.then
54 ; CHECK: lw $5, 0($[[T0]])
55 ; CHECK: lw $25, %call16(printf)
57 %arrayidx15.pre-phi = phi ptr [ %add.ptr5, %if.else ], [ %arrayidx15.pre, %if.then ]
58 %tmp7 = load i32, ptr %tmp1, align 4
59 %arrayidx9 = getelementptr inbounds i8, ptr %tmp1, i32 4
60 %tmp10 = load i32, ptr %arrayidx9, align 4
61 %arrayidx12 = getelementptr inbounds i8, ptr %tmp1, i32 8
62 %tmp13 = load i32, ptr %arrayidx12, align 4
63 %tmp16 = load i32, ptr %arrayidx15.pre-phi, align 4
64 %arrayidx18 = getelementptr inbounds i8, ptr %tmp1, i32 16
65 %tmp19 = load i32, ptr %arrayidx18, align 4
66 %arrayidx21 = getelementptr inbounds i8, ptr %tmp1, i32 20
67 %tmp22 = load i32, ptr %arrayidx21, align 4
68 %arrayidx24 = getelementptr inbounds i8, ptr %tmp1, i32 24
69 %tmp25 = load i32, ptr %arrayidx24, align 4
70 %call = call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp7, i32 %tmp10, i32 %tmp13, i32 %tmp16, i32 %tmp19, i32 %tmp22, i32 %tmp25) nounwind
74 declare void @foo3(ptr)
76 declare i32 @printf(ptr nocapture, ...) nounwind