summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-05 21:48:13 +0000
committerChris Lattner <sabre@nondot.org>2010-01-05 21:48:13 +0000
commit50ca0204c5b81c736c26f07fc49a0c19594f1d10 (patch)
tree14c0d902bf02c7ad0b287ceefbf8cabc8952bec0
parent69d02e0a174151e0f129731452e819b91d1ab90e (diff)
downloadllvm-50ca0204c5b81c736c26f07fc49a0c19594f1d10.tar.gz
llvm-50ca0204c5b81c736c26f07fc49a0c19594f1d10.tar.bz2
llvm-50ca0204c5b81c736c26f07fc49a0c19594f1d10.tar.xz
merge cast2 into cast.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92784 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/InstCombine/cast.ll37
-rw-r--r--test/Transforms/InstCombine/cast2.ll37
2 files changed, 37 insertions, 37 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index 5f75cd0a89..5bcfded872 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/test/Transforms/InstCombine/cast.ll
@@ -337,3 +337,40 @@ define i64 @test38(i32 %a) {
; CHECK: %2 = zext i1 %1 to i64
; CHECK: ret i64 %2
}
+
+define i16 @test39(i16 %a) {
+ %tmp = zext i16 %a to i32
+ %tmp21 = lshr i32 %tmp, 8
+ %tmp5 = shl i32 %tmp, 8
+ %tmp.upgrd.32 = or i32 %tmp21, %tmp5
+ %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16
+ ret i16 %tmp.upgrd.3
+; CHECK: @test39
+; CHECK: %tmp.upgrd.32 = call i16 @llvm.bswap.i16(i16 %a)
+; CHECK: ret i16 %tmp.upgrd.32
+}
+
+define i16 @test40(i16 %a) {
+ %tmp = zext i16 %a to i32
+ %tmp21 = lshr i32 %tmp, 9
+ %tmp5 = shl i32 %tmp, 8
+ %tmp.upgrd.32 = or i32 %tmp21, %tmp5
+ %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16
+ ret i16 %tmp.upgrd.3
+; CHECK: @test40
+; CHECK: %tmp21 = lshr i16 %a, 9
+; CHECK: %tmp5 = shl i16 %a, 8
+; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5
+; CHECK: ret i16 %tmp.upgrd.32
+}
+
+; PR1263
+define i32* @test41(i32* %tmp1) {
+ %tmp64 = bitcast i32* %tmp1 to { i32 }*
+ %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0
+ ret i32* %tmp65
+; CHECK: @test41
+; CHECK: ret i32* %tmp1
+}
+
+
diff --git a/test/Transforms/InstCombine/cast2.ll b/test/Transforms/InstCombine/cast2.ll
deleted file mode 100644
index 2941ee0e70..0000000000
--- a/test/Transforms/InstCombine/cast2.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; Tests to make sure elimination of casts is working correctly
-; RUN: opt < %s -instcombine -S | FileCheck %s
-target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
-
-define i16 @test1(i16 %a) {
- %tmp = zext i16 %a to i32 ; <i32> [#uses=2]
- %tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
- %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.upgrd.3
-; CHECK: %tmp.upgrd.32 = call i16 @llvm.bswap.i16(i16 %a)
-; CHECK: ret i16 %tmp.upgrd.32
-}
-
-define i16 @test2(i16 %a) {
- %tmp = zext i16 %a to i32 ; <i32> [#uses=2]
- %tmp21 = lshr i32 %tmp, 9 ; <i32> [#uses=1]
- %tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1]
- %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
- %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
- ret i16 %tmp.upgrd.3
-; CHECK: %tmp21 = lshr i16 %a, 9
-; CHECK: %tmp5 = shl i16 %a, 8
-; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5
-; CHECK: ret i16 %tmp.upgrd.32
-}
-
-; PR1263
-define i32* @test3(i32* %tmp1) {
- %tmp64 = bitcast i32* %tmp1 to { i32 }* ; <{ i32 }*> [#uses=1]
- %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 ; <i32*> [#uses=1]
- ret i32* %tmp65
-; CHECK: ret i32* %tmp1
-}
-
-