diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-05-22 15:41:53 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-05-22 15:41:53 +0000 |
commit | e2e89ef93604fefb1a145d26e12f43da7a5f24d2 (patch) | |
tree | 6a066966e9d915b590c26985b6c8c689851d175c /llvm/test/Transforms/InstCombine/shift.ll | |
parent | 4f3fe5b1a6c0bc555d39d4847a9573c1060e045a (diff) | |
download | bcm5719-llvm-e2e89ef93604fefb1a145d26e12f43da7a5f24d2.tar.gz bcm5719-llvm-e2e89ef93604fefb1a145d26e12f43da7a5f24d2.zip |
[ValueTracking, InstCombine] extend isKnownToBeAPowerOfTwo() to handle vector splat constants
We could try harder to handle non-splat vector constants too,
but that seems much rarer to me.
Note that the div test isn't resolved because there's a check
for isIntegerTy() guarding that transform.
Differential Revision: http://reviews.llvm.org/D20497
llvm-svn: 270369
Diffstat (limited to 'llvm/test/Transforms/InstCombine/shift.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/shift.ll | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll index e4dd377952a..755c4a7f9f1 100644 --- a/llvm/test/Transforms/InstCombine/shift.ll +++ b/llvm/test/Transforms/InstCombine/shift.ll @@ -700,11 +700,9 @@ define i32 @test42(i32 %a, i32 %b) nounwind { ret i32 %div2 } -; FIXME: Vector lshr should be treated the same as scalar. - define <2 x i32> @test42vec(<2 x i32> %a, <2 x i32> %b) { ; CHECK-LABEL: @test42vec( -; CHECK-NEXT: [[DIV:%.*]] = lshr <2 x i32> <i32 4096, i32 4096>, %b +; CHECK-NEXT: [[DIV:%.*]] = lshr exact <2 x i32> <i32 4096, i32 4096>, %b ; CHECK-NEXT: [[DIV2:%.*]] = udiv <2 x i32> %a, [[DIV]] ; CHECK-NEXT: ret <2 x i32> [[DIV2]] ; |