summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-12-23 23:56:24 +0000
committerOwen Anderson <resistor@mac.com>2010-12-23 23:56:24 +0000
commit226ac14afb74b67007d133e3bb16ca05642b4caa (patch)
treeadccd9485f5b9996ee274e5f23b3536d0eee0bba /llvm/test/Transforms/InstCombine
parent62de0fa6719601358b9bbe9e4d5db0d5fc552979 (diff)
downloadbcm5719-llvm-226ac14afb74b67007d133e3bb16ca05642b4caa.tar.gz
bcm5719-llvm-226ac14afb74b67007d133e3bb16ca05642b4caa.zip
When determining if we can fold (x >> C1) << C2, the bits that we need to verify are zero
are not the low bits of x, but the bits that WILL be the low bits after the operation completes. llvm-svn: 122529
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/shift.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll
index 8d1c82991fd..4f6939d6323 100644
--- a/llvm/test/Transforms/InstCombine/shift.ll
+++ b/llvm/test/Transforms/InstCombine/shift.ll
@@ -452,3 +452,22 @@ define i32 @test38(i32 %x) nounwind readnone {
; CHECK-NEXT: ret i32
}
+; <rdar://problem/8756731>
+; CHECK: @test39
+define i8 @test39(i32 %a0) {
+entry:
+ %tmp4 = trunc i32 %a0 to i8
+; CHECK: and i8 %tmp49, 64
+ %tmp5 = shl i8 %tmp4, 5
+ %tmp48 = and i8 %tmp5, 32
+ %tmp49 = lshr i8 %tmp48, 5
+ %tmp50 = mul i8 %tmp49, 64
+ %tmp51 = xor i8 %tmp50, %tmp5
+; CHECK: and i8 %0, 16
+ %tmp52 = and i8 %tmp51, -128
+ %tmp53 = lshr i8 %tmp52, 7
+ %tmp54 = mul i8 %tmp53, 16
+ %tmp55 = xor i8 %tmp54, %tmp51
+; CHECK: ret i8 %tmp551
+ ret i8 %tmp55
+}
OpenPOWER on IntegriCloud