diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-04-13 06:55:52 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-04-13 06:55:52 +0000 |
commit | 3ee5f3446970524a66b1fa2b251453c1c0369356 (patch) | |
tree | c12bda92a8c30c2fd03f942a301a34ab2382f9e0 /llvm/test | |
parent | ce23e9702e0fc4011355e3fe1e3ab876b77fc4ac (diff) | |
download | bcm5719-llvm-3ee5f3446970524a66b1fa2b251453c1c0369356.tar.gz bcm5719-llvm-3ee5f3446970524a66b1fa2b251453c1c0369356.zip |
[InstCombine] We folded an fcmp to an i1 instead of a vector of i1
Remove an ad-hoc transform in InstCombine and replace it with more
general machinery (ValueTracking, InstructionSimplify and VectorUtils).
This fixes PR27332.
llvm-svn: 266175
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/InstCombine/pr27332.ll | 11 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/zero-point-zero-add.ll | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/llvm/test/Transforms/InstCombine/pr27332.ll b/llvm/test/Transforms/InstCombine/pr27332.ll new file mode 100644 index 00000000000..543ffbe1fa7 --- /dev/null +++ b/llvm/test/Transforms/InstCombine/pr27332.ll @@ -0,0 +1,11 @@ +; RUN: opt -instcombine -S -o - < %s | FileCheck %s +declare <4 x float> @llvm.fabs.v4f32(<4 x float>) + +define <4 x i1> @test1(<4 x float> %V) { +entry: + %abs = call <4 x float> @llvm.fabs.v4f32(<4 x float> %V) + %cmp = fcmp olt <4 x float> %abs, zeroinitializer + ret <4 x i1> %cmp +} +; CHECK-LABEL: define <4 x i1> @test1( +; CHECK: ret <4 x i1> zeroinitializer diff --git a/llvm/test/Transforms/InstCombine/zero-point-zero-add.ll b/llvm/test/Transforms/InstCombine/zero-point-zero-add.ll index 42004017c39..e466e8ad742 100644 --- a/llvm/test/Transforms/InstCombine/zero-point-zero-add.ll +++ b/llvm/test/Transforms/InstCombine/zero-point-zero-add.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -declare double @abs(double) +declare double @fabs(double) readonly define double @test(double %X) { ; CHECK-LABEL: @test( @@ -15,10 +15,10 @@ define double @test(double %X) { define double @test1(double %X) { ; CHECK-LABEL: @test1( -; CHECK-NEXT: [[Y:%.*]] = call double @abs(double %X) +; CHECK-NEXT: [[Y:%.*]] = call double @fabs(double %X) ; CHECK-NEXT: ret double [[Y]] ; - %Y = call double @abs(double %X) + %Y = call double @fabs(double %X) %Z = fadd double %Y, 0.0 ret double %Z } |