aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-17 20:47:23 +0000
committerChris Lattner <sabre@nondot.org>2009-02-17 20:47:23 +0000
commit215d56ebe19f169da2552b1ec73ea179e53f6bf1 (patch)
tree0c415987b9f976d0bf4685e89ffe9353acbdd486 /test/Transforms
parent26a00a344109ba2c6f2098a0bebd58baf28a9bf4 (diff)
downloadexternal_llvm-215d56ebe19f169da2552b1ec73ea179e53f6bf1.zip
external_llvm-215d56ebe19f169da2552b1ec73ea179e53f6bf1.tar.gz
external_llvm-215d56ebe19f169da2552b1ec73ea179e53f6bf1.tar.bz2
commit a tweaked version of Daniel's patch for PR3599. We now
eliminate all the extensions and all but the one required truncate from the testcase, but the or/and/shift stuff still isn't zapped. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/zext.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/zext.ll b/test/Transforms/InstCombine/zext.ll
index ceb8deb..c0fa377 100644
--- a/test/Transforms/InstCombine/zext.ll
+++ b/test/Transforms/InstCombine/zext.ll
@@ -8,3 +8,26 @@ define i64 @test_sext_zext(i16 %A) {
ret i64 %c2
}
+; PR3599
+define i32 @test2(i64 %tmp) nounwind readnone {
+entry:
+ %tmp5 = trunc i64 %tmp to i8 ; <i8> [#uses=1]
+ %tmp7 = lshr i64 %tmp, 8 ; <i64> [#uses=1]
+ %tmp8 = trunc i64 %tmp7 to i8 ; <i8> [#uses=1]
+ %tmp10 = lshr i64 %tmp, 16 ; <i64> [#uses=1]
+ %tmp11 = trunc i64 %tmp10 to i8 ; <i8> [#uses=1]
+ %tmp13 = lshr i64 %tmp, 24 ; <i64> [#uses=1]
+ %tmp14 = trunc i64 %tmp13 to i8 ; <i8> [#uses=1]
+ %tmp1 = zext i8 %tmp5 to i32 ; <i32> [#uses=1]
+ %tmp2 = zext i8 %tmp8 to i32 ; <i32> [#uses=1]
+ %tmp3 = shl i32 %tmp2, 8 ; <i32> [#uses=1]
+ %tmp4 = zext i8 %tmp11 to i32 ; <i32> [#uses=1]
+ %tmp6 = shl i32 %tmp4, 16 ; <i32> [#uses=1]
+ %tmp9 = zext i8 %tmp14 to i32 ; <i32> [#uses=1]
+ %tmp12 = shl i32 %tmp9, 24 ; <i32> [#uses=1]
+ %tmp15 = or i32 %tmp12, %tmp1 ; <i32> [#uses=1]
+ %tmp16 = or i32 %tmp15, %tmp6 ; <i32> [#uses=1]
+ %tmp17 = or i32 %tmp16, %tmp3 ; <i32> [#uses=1]
+ ret i32 %tmp17
+}
+