diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-05-24 22:58:17 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-05-24 22:58:17 +0000 |
commit | 07b1ba54b5403617523b0501adc83c2b91d782ab (patch) | |
tree | b41546dbcd8341ed0f94ad2f69452d0ec096d334 /llvm/test/Transforms | |
parent | 3c8f953f6193f9199a2b9b69834a4b3a2ad44701 (diff) | |
download | bcm5719-llvm-07b1ba54b5403617523b0501adc83c2b91d782ab.tar.gz bcm5719-llvm-07b1ba54b5403617523b0501adc83c2b91d782ab.zip |
[InstCombine] use m_APInt to allow icmp-mul-mul vector fold
The swapped operands in the first test is a manifestation of an
inefficiency for vectors that doesn't exist for scalars because
the IRBuilder checks for an all-ones mask for scalars, but not
vectors.
llvm-svn: 303818
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index 9a952bad1da..39df422a518 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -2920,9 +2920,7 @@ define i1 @eq_mul_constants(i32 %x, i32 %y) { define <2 x i1> @eq_mul_constants_splat(<2 x i32> %x, <2 x i32> %y) { ; CHECK-LABEL: @eq_mul_constants_splat( -; CHECK-NEXT: [[A:%.*]] = mul <2 x i32> %x, <i32 5, i32 5> -; CHECK-NEXT: [[B:%.*]] = mul <2 x i32> %y, <i32 5, i32 5> -; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> [[A]], [[B]] +; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> %y, %x ; CHECK-NEXT: ret <2 x i1> [[C]] ; %A = mul <2 x i32> %x, <i32 5, i32 5> @@ -2950,9 +2948,9 @@ define i1 @eq_mul_constants_with_tz(i32 %x, i32 %y) { define <2 x i1> @eq_mul_constants_with_tz_splat(<2 x i32> %x, <2 x i32> %y) { ; CHECK-LABEL: @eq_mul_constants_with_tz_splat( -; CHECK-NEXT: [[A:%.*]] = mul <2 x i32> %x, <i32 12, i32 12> -; CHECK-NEXT: [[B:%.*]] = mul <2 x i32> %y, <i32 12, i32 12> -; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[A]], [[B]] +; CHECK-NEXT: [[TMP1:%.*]] = xor <2 x i32> %x, %y +; CHECK-NEXT: [[TMP2:%.*]] = and <2 x i32> [[TMP1]], <i32 1073741823, i32 1073741823> +; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[TMP2]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[C]] ; %A = mul <2 x i32> %x, <i32 12, i32 12> |