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
This commit is contained in:
Evan Cheng
2009-01-16 02:11:43 +00:00
parent 05aae18165
commit 4e56ab2cf4
2 changed files with 62 additions and 30 deletions
+7
View File
@@ -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
}