diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-08-03 18:59:03 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-03 18:59:03 +0000 |
commit | 43aeb001c959098167dec6272160ee73d187067c (patch) | |
tree | 5c30121127b054ce32bbb6323f10c63b37a0b0d9 /llvm/test/Transforms/InstCombine/add.ll | |
parent | bfb6072d84fbd6169d57afe9d812de1abca7b5d7 (diff) | |
download | bcm5719-llvm-43aeb001c959098167dec6272160ee73d187067c.tar.gz bcm5719-llvm-43aeb001c959098167dec6272160ee73d187067c.zip |
[InstCombine] use m_APInt to allow icmp (binop X, Y), C folds with constant splat vectors
This removes the restriction for the icmp constant, but as noted by the FIXME comments,
we still need to change individual checks for binop operand constants.
llvm-svn: 277629
Diffstat (limited to 'llvm/test/Transforms/InstCombine/add.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/add.ll | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/test/Transforms/InstCombine/add.ll b/llvm/test/Transforms/InstCombine/add.ll index e75c032174e..10c15928efb 100644 --- a/llvm/test/Transforms/InstCombine/add.ll +++ b/llvm/test/Transforms/InstCombine/add.ll @@ -109,12 +109,10 @@ define i1 @test10(i8 %A, i8 %b) { ret i1 %c } -; FIXME: Vectors should fold the same way. - define <2 x i1> @test10vec(<2 x i8> %a, <2 x i8> %b) { ; CHECK-LABEL: @test10vec( -; CHECK-NEXT: [[C:%.*]] = add <2 x i8> %a, %b -; CHECK-NEXT: [[D:%.*]] = icmp ne <2 x i8> [[C]], zeroinitializer +; CHECK-NEXT: [[C:%.*]] = sub <2 x i8> zeroinitializer, %b +; CHECK-NEXT: [[D:%.*]] = icmp ne <2 x i8> %a, [[C]] ; CHECK-NEXT: ret <2 x i1> [[D]] ; %c = add <2 x i8> %a, %b @@ -133,11 +131,9 @@ define i1 @test11(i8 %A) { ret i1 %c } -; FIXME: Vectors should fold the same way. define <2 x i1> @test11vec(<2 x i8> %a) { ; CHECK-LABEL: @test11vec( -; CHECK-NEXT: [[B:%.*]] = add <2 x i8> %a, <i8 -1, i8 -1> -; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i8> [[B]], zeroinitializer +; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i8> %a, <i8 1, i8 1> ; CHECK-NEXT: ret <2 x i1> [[C]] ; %b = add <2 x i8> %a, <i8 -1, i8 -1> |