diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-10 20:30:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-10 20:30:41 +0000 |
commit | 11ea81242473027c67395e9e94396f4e2a282dda (patch) | |
tree | c0cfca19ce99f6a0da2bf503dc96f5bab86d61ef /test/Transforms | |
parent | 9ee947c224a157a5fb2c921a0e194fddedef2f9f (diff) | |
download | llvm-11ea81242473027c67395e9e94396f4e2a282dda.tar.gz llvm-11ea81242473027c67395e9e94396f4e2a282dda.tar.bz2 llvm-11ea81242473027c67395e9e94396f4e2a282dda.tar.xz |
teach sext optimization to handle truncs from types that are not
the dest of the sext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/cast.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index 8424967e11..d624f342b9 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -523,3 +523,29 @@ define i64 @test53(i32 %A) { ; CHECK-NEXT: %D = and i64 %C, 40186 ; CHECK-NEXT: ret i64 %D } + +define i32 @test54(i64 %A) { + %B = trunc i64 %A to i16 + %C = or i16 %B, -32574 + %D = and i16 %C, -25350 + %E = sext i16 %D to i32 + ret i32 %E +; CHECK: @test54 +; CHECK-NEXT: %B = trunc i64 %A to i32 +; CHECK-NEXT: %C = or i32 %B, -32574 +; CHECK-NEXT: %D = and i32 %C, -25350 +; CHECK-NEXT: ret i32 %D +} + +define i64 @test55(i32 %A) { + %B = trunc i32 %A to i16 + %C = or i16 %B, -32574 + %D = and i16 %C, -25350 + %E = sext i16 %D to i64 + ret i64 %E +; CHECK: @test55 +; CHECK-NEXT: %B = zext i32 %A to i64 +; CHECK-NEXT: %C = or i64 %B, -32574 +; CHECK-NEXT: %D = and i64 %C, -25350 +; CHECK-NEXT: ret i64 %D +}
\ No newline at end of file |