diff options
| author | Craig Topper <craig.topper@intel.com> | 2017-09-20 23:48:58 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2017-09-20 23:48:58 +0000 |
| commit | 18887bf1795715fd3b52c22ca543ff7290defa1b (patch) | |
| tree | 0ce939a170f471548df20d4e25d8215641bf59c6 /llvm/test/Transforms | |
| parent | eb0f71f2328a04ebafa0791700ca682647157ca4 (diff) | |
| download | bcm5719-llvm-18887bf1795715fd3b52c22ca543ff7290defa1b.tar.gz bcm5719-llvm-18887bf1795715fd3b52c22ca543ff7290defa1b.zip | |
[InstCombine] Teach getDemandedBitsLHSMask to handle constant splat vectors
This replaces a ConstantInt dyn_cast with m_APInt
Differential Revision: https://reviews.llvm.org/D38100
llvm-svn: 313840
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index 8bbc6c5c9e8..a9ad19a0cdc 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -1163,11 +1163,10 @@ define <2 x i1> @test67vec(<2 x i32> %x) { ret <2 x i1> %cmp } -; FIXME: Vector constant for the 'and' should use less bits. define <2 x i1> @test67vec2(<2 x i32> %x) { ; CHECK-LABEL: @test67vec2( -; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> %x, <i32 127, i32 127> -; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[AND]], <i32 31, i32 31> +; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[X:%.*]], <i32 96, i32 96> +; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[AND]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %and = and <2 x i32> %x, <i32 127, i32 127> @@ -1997,10 +1996,9 @@ define i1 @shrink_constant(i32 %X) { ret i1 %cmp } -; FIXME: This doesn't change because of a limitation in 'DemandedBitsLHSMask'. define <2 x i1> @shrink_constant_vec(<2 x i32> %X) { ; CHECK-LABEL: @shrink_constant_vec( -; CHECK-NEXT: [[XOR:%.*]] = xor <2 x i32> %X, <i32 -9, i32 -9> +; CHECK-NEXT: [[XOR:%.*]] = xor <2 x i32> [[X:%.*]], <i32 -12, i32 -12> ; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[XOR]], <i32 4, i32 4> ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; |

