diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-02-13 00:31:44 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-02-13 00:31:44 +0000 |
commit | 01abf8fc2fc93c317f5f89e36c8999565b0dd7d8 (patch) | |
tree | e1af6cc6661dd42219044e97709796cef1789d89 /llvm/test | |
parent | fe873e7c10bd062ccd8a9505ed0220a5df07acd0 (diff) | |
download | bcm5719-llvm-01abf8fc2fc93c317f5f89e36c8999565b0dd7d8.tar.gz bcm5719-llvm-01abf8fc2fc93c317f5f89e36c8999565b0dd7d8.zip |
Besides removing phi cycles that reduce to a single value, also remove dead
phi cycles. Adjust a few tests to keep dead instructions from being optimized
away. This (together with my previous change for phi cycles) fixes Apple
radar 7627077.
llvm-svn: 96057
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/Thumb2/2010-02-11-phi-cycle.ll | 38 | ||||
-rw-r--r-- | llvm/test/CodeGen/Thumb2/thumb2-spill-q.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/pre-split8.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/pre-split9.ll | 2 |
4 files changed, 42 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/Thumb2/2010-02-11-phi-cycle.ll b/llvm/test/CodeGen/Thumb2/2010-02-11-phi-cycle.ll index 997257885e6..0f23ee75683 100644 --- a/llvm/test/CodeGen/Thumb2/2010-02-11-phi-cycle.ll +++ b/llvm/test/CodeGen/Thumb2/2010-02-11-phi-cycle.ll @@ -29,6 +29,44 @@ return: ; preds = %bb, %entry ret i32 undef } +define arm_apcscc i32 @test_dead_cycle(i32 %n) nounwind { +; CHECK: test_dead_cycle: +; CHECK: blx +; CHECK-NOT: mov +; CHECK: blx +entry: + %0 = icmp eq i32 %n, 1 ; <i1> [#uses=1] + br i1 %0, label %return, label %bb.nph + +bb.nph: ; preds = %entry + %tmp = add i32 %n, -1 ; <i32> [#uses=2] + br label %bb + +bb: ; preds = %bb.nph, %bb2 + %indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %bb2 ] ; <i32> [#uses=2] + %u.17 = phi i64 [ undef, %bb.nph ], [ %u.0, %bb2 ] ; <i64> [#uses=2] + %tmp9 = sub i32 %tmp, %indvar ; <i32> [#uses=1] + %1 = icmp sgt i32 %tmp9, 1 ; <i1> [#uses=1] + br i1 %1, label %bb1, label %bb2 + +bb1: ; preds = %bb + %2 = tail call arm_apcscc i32 @f() nounwind ; <i32> [#uses=1] + %tmp6 = zext i32 %2 to i64 ; <i64> [#uses=1] + %mask = and i64 %u.17, -4294967296 ; <i64> [#uses=1] + %ins = or i64 %tmp6, %mask ; <i64> [#uses=1] + tail call arm_apcscc void @g(i64 %ins) nounwind + br label %bb2 + +bb2: ; preds = %bb1, %bb + %u.0 = phi i64 [ %ins, %bb1 ], [ %u.17, %bb ] ; <i64> [#uses=2] + %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] + %exitcond = icmp eq i32 %indvar.next, %tmp ; <i1> [#uses=1] + br i1 %exitcond, label %return, label %bb + +return: ; preds = %bb2, %entry + ret i32 undef +} + declare arm_apcscc i32 @f() declare arm_apcscc void @g(i64) diff --git a/llvm/test/CodeGen/Thumb2/thumb2-spill-q.ll b/llvm/test/CodeGen/Thumb2/thumb2-spill-q.ll index 79351637618..ff178b42fb3 100644 --- a/llvm/test/CodeGen/Thumb2/thumb2-spill-q.ll +++ b/llvm/test/CodeGen/Thumb2/thumb2-spill-q.ll @@ -12,8 +12,8 @@ declare <4 x float> @llvm.arm.neon.vld1.v4f32(i8*) nounwind readonly define arm_apcscc void @aaa(%quuz* %this, i8* %block) { ; CHECK: aaa: ; CHECK: bic r4, r4, #15 -; CHECK: vst1.64 {{.*}}[r{{.*}}, :128] -; CHECK: vld1.64 {{.*}}[r{{.*}}, :128] +; CHECK: vst1.64 {{.*}}[{{.*}}, :128] +; CHECK: vld1.64 {{.*}}[{{.*}}, :128] entry: %0 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* undef) nounwind ; <<4 x float>> [#uses=1] store float 6.300000e+01, float* undef, align 4 diff --git a/llvm/test/CodeGen/X86/pre-split8.ll b/llvm/test/CodeGen/X86/pre-split8.ll index ea4b9496b3c..0684bd036ce 100644 --- a/llvm/test/CodeGen/X86/pre-split8.ll +++ b/llvm/test/CodeGen/X86/pre-split8.ll @@ -20,7 +20,7 @@ bb: ; preds = %bb9.i, %entry bb9.i: ; preds = %bb %2 = fsub double %.rle4, %0 ; <double> [#uses=0] - %3 = tail call double @asin(double 0.000000e+00) nounwind readonly ; <double> [#uses=0] + %3 = tail call double @asin(double %.rle4) nounwind readonly ; <double> [#uses=0] %4 = fmul double 0.000000e+00, %0 ; <double> [#uses=1] %5 = tail call double @tan(double 0.000000e+00) nounwind readonly ; <double> [#uses=0] %6 = fmul double %4, 0.000000e+00 ; <double> [#uses=1] diff --git a/llvm/test/CodeGen/X86/pre-split9.ll b/llvm/test/CodeGen/X86/pre-split9.ll index c27d925d43e..86dda33533f 100644 --- a/llvm/test/CodeGen/X86/pre-split9.ll +++ b/llvm/test/CodeGen/X86/pre-split9.ll @@ -22,7 +22,7 @@ bb: ; preds = %bb9.i, %entry bb9.i: ; preds = %bb %2 = fsub double %.rle4, %0 ; <double> [#uses=0] - %3 = tail call double @asin(double 0.000000e+00) nounwind readonly ; <double> [#uses=0] + %3 = tail call double @asin(double %.rle4) nounwind readonly ; <double> [#uses=0] %4 = tail call double @sin(double 0.000000e+00) nounwind readonly ; <double> [#uses=1] %5 = fmul double %4, %0 ; <double> [#uses=1] %6 = tail call double @tan(double 0.000000e+00) nounwind readonly ; <double> [#uses=0] |