target triple = "i386-apple-darwin7"
define i32 @test1(i32* %b, i32* %c) nounwind {
-; CHECK: @test1
+; CHECK-LABEL: @test1(
entry:
%g = alloca i32
%t1 = icmp eq i32* %b, null
}
define i8 @test2(i1 %cond, i32* %b, i32* %c) nounwind {
-; CHECK: @test2
+; CHECK-LABEL: @test2(
entry:
br i1 %cond, label %bb, label %bb1
}
define i32 @test3(i1 %cond, i32* %b, i32* %c) nounwind {
-; CHECK: @test3
+; CHECK-LABEL: @test3(
entry:
br i1 %cond, label %bb, label %bb1
; PR5313
define i32 @test4(i1 %cond, i32* %b, i32* %c) nounwind {
-; CHECK: @test4
+; CHECK-LABEL: @test4(
entry:
br i1 %cond, label %bb, label %bb1
ret i32 %dv
}
+
+
+; void test5(int N, double* G) {
+; for (long j = 1; j < 1000; j++)
+; G[j] = G[j] + G[j-1];
+; }
+;
+; Should compile into one load in the loop.
+define void @test5(i32 %N, double* nocapture %G) nounwind ssp {
+; CHECK-LABEL: @test5(
+bb.nph:
+ br label %for.body
+
+for.body:
+ %indvar = phi i64 [ 0, %bb.nph ], [ %tmp, %for.body ]
+ %arrayidx6 = getelementptr double* %G, i64 %indvar
+ %tmp = add i64 %indvar, 1
+ %arrayidx = getelementptr double* %G, i64 %tmp
+ %tmp3 = load double* %arrayidx
+ %tmp7 = load double* %arrayidx6
+ %add = fadd double %tmp3, %tmp7
+ store double %add, double* %arrayidx
+ %exitcond = icmp eq i64 %tmp, 999
+ br i1 %exitcond, label %for.end, label %for.body
+; CHECK: for.body:
+; CHECK: phi double
+; CHECK: load double
+; CHECK-NOT: load double
+; CHECK: br i1
+for.end:
+ ret void
+}