diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/2010-11-01-lshr-mask.ll | 4 | ||||
-rw-r--r-- | test/Transforms/InstCombine/shift.ll | 76 | ||||
-rw-r--r-- | test/Transforms/InstCombine/signext.ll | 4 |
3 files changed, 80 insertions, 4 deletions
diff --git a/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll b/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll index eb28994756..5efad8a789 100644 --- a/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll +++ b/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll @@ -5,8 +5,8 @@ define i32 @main(i32 %argc) nounwind ssp { entry: %tmp3151 = trunc i32 %argc to i8 -; CHECK: %tmp3163 = shl i8 %tmp3162, 6 -; CHECK: and i8 %tmp3163, 64 +; CHECK: %tmp3162 = shl i8 %tmp3151, 5 +; CHECK: and i8 %tmp3162, 64 ; CHECK-NOT: shl ; CHECK-NOT: shr %tmp3161 = or i8 %tmp3151, -17 diff --git a/test/Transforms/InstCombine/shift.ll b/test/Transforms/InstCombine/shift.ll index 25e708b7f5..b152816d2b 100644 --- a/test/Transforms/InstCombine/shift.ll +++ b/test/Transforms/InstCombine/shift.ll @@ -659,3 +659,79 @@ define i32 @test53(i32 %x) { ; CHECK-NEXT: %B = shl nuw i32 %x, 2 ; CHECK-NEXT: ret i32 %B } + +define i32 @test54(i32 %x) { + %shr2 = lshr i32 %x, 1 + %shl = shl i32 %shr2, 4 + %and = and i32 %shl, 16 + ret i32 %and +; CHECK: @test54 +; CHECK: shl i32 %x, 3 +} + + +define i32 @test55(i32 %x) { + %shr2 = lshr i32 %x, 1 + %shl = shl i32 %shr2, 4 + %or = or i32 %shl, 8 + ret i32 %or +; CHECK: @test55 +; CHECK: shl i32 %x, 3 +} + +define i32 @test56(i32 %x) { + %shr2 = lshr i32 %x, 1 + %shl = shl i32 %shr2, 4 + %or = or i32 %shl, 7 + ret i32 %or +; CHECK: @test56 +; CHECK: shl i32 %shr2, 4 +} + + +define i32 @test57(i32 %x) { + %shr = lshr i32 %x, 1 + %shl = shl i32 %shr, 4 + %and = and i32 %shl, 16 + ret i32 %and +; CHECK: @test57 +; CHECK: shl i32 %x, 3 +} + +define i32 @test58(i32 %x) { + %shr = lshr i32 %x, 1 + %shl = shl i32 %shr, 4 + %or = or i32 %shl, 8 + ret i32 %or +; CHECK: @test58 +; CHECK: shl i32 %x, 3 +} + +define i32 @test59(i32 %x) { + %shr = ashr i32 %x, 1 + %shl = shl i32 %shr, 4 + %or = or i32 %shl, 7 + ret i32 %or +; CHECK: @test59 +; CHECK: %shl = shl i32 %shr1, 4 +} + + +define i32 @test60(i32 %x) { + %shr = ashr i32 %x, 4 + %shl = shl i32 %shr, 1 + %or = or i32 %shl, 1 + ret i32 %or +; CHECK: @test60 +; CHECK: lshr i32 %x, 3 +} + + +define i32 @test61(i32 %x) { + %shr = ashr i32 %x, 4 + %shl = shl i32 %shr, 1 + %or = or i32 %shl, 2 + ret i32 %or +; CHECK: @test61 +; CHECK: ashr i32 %x, 4 +} diff --git a/test/Transforms/InstCombine/signext.ll b/test/Transforms/InstCombine/signext.ll index ecee9830cd..5ed1cd5590 100644 --- a/test/Transforms/InstCombine/signext.ll +++ b/test/Transforms/InstCombine/signext.ll @@ -82,6 +82,6 @@ entry: %sub = add i32 %xor, -67108864 ; <i32> [#uses=1] ret i32 %sub ; CHECK: @test8 -; CHECK: %shr = ashr i32 %x, 5 -; CHECK: ret i32 %shr +; CHECK: %sub = ashr i32 %x, 5 +; CHECK: ret i32 %sub } |