summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-01-16 02:11:43 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-01-16 02:11:43 +0000
commitbeac6f8b0c700248719c38b3d345b03a35e98a5b (patch)
treea20b8cd21b1c7ca3ad7f264b2db6ac13982b91ef /llvm/test
parent3e35fe8968e080da2ab5e7ff72b480a2ef85e8b2 (diff)
downloadbcm5719-llvm-beac6f8b0c700248719c38b3d345b03a35e98a5b.tar.gz
bcm5719-llvm-beac6f8b0c700248719c38b3d345b03a35e98a5b.zip
Clean up previous cast optimization a bit. Also make zext elimination a bit more aggressive: if it's not necessary to emit an AND (i.e. high bits are already zero), it's profitable to evaluate the operand at a different type.
llvm-svn: 62297
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/cast.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll
index 9361ff24e9b..7a1e7a802dd 100644
--- a/llvm/test/Transforms/InstCombine/cast.ll
+++ b/llvm/test/Transforms/InstCombine/cast.ll
@@ -254,3 +254,10 @@ define i1 @test37(i32 %a) {
ret i1 %e
}
+define i64 @test38(i32 %a) {
+ %1 = icmp eq i32 %a, -2
+ %2 = zext i1 %1 to i8
+ %3 = xor i8 %2, 1
+ %4 = zext i8 %3 to i64
+ ret i64 %4
+}
OpenPOWER on IntegriCloud