diff options
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/cast.ll | 37 | ||||
-rw-r--r-- | test/Transforms/InstCombine/cast2.ll | 37 |
2 files changed, 37 insertions, 37 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index 5f75cd0..5bcfded 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 2941ee0..0000000 --- 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 -} - - |