summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/cast.ll
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
commit4e56ab2cf4ef7dc693b6110df60ce2a07187868f (patch)
tree20449b7813fb2b6fe368b2d79aa71440ceff5ec3 /test/Transforms/InstCombine/cast.ll
parent05aae18165a41e2bb0e7de0eba2656cc5537b162 (diff)
downloadllvm-4e56ab2cf4ef7dc693b6110df60ce2a07187868f.tar.gz
llvm-4e56ab2cf4ef7dc693b6110df60ce2a07187868f.tar.bz2
llvm-4e56ab2cf4ef7dc693b6110df60ce2a07187868f.tar.xz
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/cast.ll')
-rw-r--r--test/Transforms/InstCombine/cast.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index 9361ff24e9..7a1e7a802d 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/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
+}