Revert remaining part of r93200: "Disable folding sext(trunc(x)) -> x"

This fixes PR5997.

These transforms were disabled because codegen couldn't deal with other
uses of trunc(x). This is now handled by the peephole pass.

This causes no regressions on x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2012-06-22 16:36:43 +00:00
parent 63e0e8d90b
commit 7ee3ca10f5
2 changed files with 11 additions and 15 deletions

View File

@@ -12,8 +12,8 @@ define i64 @test1(i64 %a) {
call void @use(i32 %b)
ret i64 %d
; CHECK: @test1
; CHECK: %d = and i64 %a, 15
; CHECK: ret i64 %d
; CHECK-NOT: ext
; CHECK: ret
}
define i64 @test2(i64 %a) {
%b = trunc i64 %a to i32
@@ -34,8 +34,8 @@ define i64 @test3(i64 %a) {
call void @use(i32 %b)
ret i64 %d
; CHECK: @test3
; CHECK: %d = and i64 %a, 8
; CHECK: ret i64 %d
; CHECK-NOT: ext
; CHECK: ret
}
define i64 @test4(i64 %a) {
%b = trunc i64 %a to i32
@@ -46,8 +46,9 @@ define i64 @test4(i64 %a) {
ret i64 %d
; CHECK: @test4
; CHECK: = and i64 %a, 8
; CHECK: %d = xor i64 {{.*}}, 8
; CHECK: ret i64 %d
; CHECK: = xor i64 {{.*}}, 8
; CHECK-NOT: ext
; CHECK: ret
}
define i32 @test5(i32 %A) {