From f5782e2d607aa86c894b15d20bd067d4b772389a Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 18 Apr 2012 17:01:26 +0000 Subject: [PATCH] FileCheckize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155010 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/apint-shift.ll | 61 +++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/test/Transforms/InstCombine/apint-shift.ll b/test/Transforms/InstCombine/apint-shift.ll index 130d0bdcd87..0ea73a058c0 100644 --- a/test/Transforms/InstCombine/apint-shift.ll +++ b/test/Transforms/InstCombine/apint-shift.ll @@ -1,70 +1,93 @@ ; This test makes sure that shift instructions are properly eliminated ; even with arbitrary precision integers. -; RUN: opt < %s -instcombine -S | not grep sh -; END. +; RUN: opt < %s -instcombine -S | FileCheck %s +; CHECK: @test1 +; CHECK-NOT: sh define i47 @test1(i47 %A) { %B = shl i47 %A, 0 ; [#uses=1] ret i47 %B } +; CHECK: @test2 +; CHECK-NOT: sh define i41 @test2(i7 %X) { %A = zext i7 %X to i41 ; [#uses=1] %B = shl i41 0, %A ; [#uses=1] ret i41 %B } +; CHECK: @test3 +; CHECK-NOT: sh define i41 @test3(i41 %A) { %B = ashr i41 %A, 0 ; [#uses=1] ret i41 %B } +; CHECK: @test4 +; CHECK-NOT: sh define i39 @test4(i7 %X) { %A = zext i7 %X to i39 ; [#uses=1] %B = ashr i39 0, %A ; [#uses=1] ret i39 %B } +; CHECK: @test5 +; CHECK-NOT: sh define i55 @test5(i55 %A) { %B = lshr i55 %A, 55 ; [#uses=1] ret i55 %B } +; CHECK: @test5a +; CHECK-NOT: sh define i32 @test5a(i32 %A) { %B = shl i32 %A, 32 ; [#uses=1] ret i32 %B } +; CHECK: @test6 +; CHECK-NOT: sh define i55 @test6(i55 %A) { %B = shl i55 %A, 1 ; [#uses=1] %C = mul i55 %B, 3 ; [#uses=1] ret i55 %C } +; CHECK: @test7 +; CHECK-NOT: sh define i29 @test7(i8 %X) { %A = zext i8 %X to i29 ; [#uses=1] %B = ashr i29 -1, %A ; [#uses=1] ret i29 %B } +; CHECK: @test8 +; CHECK-NOT: sh define i7 @test8(i7 %A) { %B = shl i7 %A, 4 ; [#uses=1] %C = shl i7 %B, 3 ; [#uses=1] ret i7 %C } +; CHECK: @test9 +; CHECK-NOT: sh define i17 @test9(i17 %A) { %B = shl i17 %A, 16 ; [#uses=1] %C = lshr i17 %B, 16 ; [#uses=1] ret i17 %C } +; CHECK: @test10 +; CHECK-NOT: sh define i19 @test10(i19 %A) { %B = lshr i19 %A, 18 ; [#uses=1] %C = shl i19 %B, 18 ; [#uses=1] ret i19 %C } +; CHECK: @test11 +; CHECK-NOT: sh define i23 @test11(i23 %A) { %a = mul i23 %A, 3 ; [#uses=1] %B = lshr i23 %a, 11 ; [#uses=1] @@ -72,12 +95,16 @@ define i23 @test11(i23 %A) { ret i23 %C } +; CHECK: @test12 +; CHECK-NOT: sh define i47 @test12(i47 %A) { %B = ashr i47 %A, 8 ; [#uses=1] %C = shl i47 %B, 8 ; [#uses=1] ret i47 %C } +; CHECK: @test13 +; CHECK-NOT: sh define i18 @test13(i18 %A) { %a = mul i18 %A, 3 ; [#uses=1] %B = ashr i18 %a, 8 ; [#uses=1] @@ -85,6 +112,8 @@ define i18 @test13(i18 %A) { ret i18 %C } +; CHECK: @test14 +; CHECK-NOT: sh define i35 @test14(i35 %A) { %B = lshr i35 %A, 4 ; [#uses=1] %C = or i35 %B, 1234 ; [#uses=1] @@ -92,6 +121,8 @@ define i35 @test14(i35 %A) { ret i35 %D } +; CHECK: @test14a +; CHECK-NOT: sh define i79 @test14a(i79 %A) { %B = shl i79 %A, 4 ; [#uses=1] %C = and i79 %B, 1234 ; [#uses=1] @@ -99,12 +130,16 @@ define i79 @test14a(i79 %A) { ret i79 %D } +; CHECK: @test15 +; CHECK-NOT: sh define i45 @test15(i1 %C) { %A = select i1 %C, i45 3, i45 1 ; [#uses=1] %V = shl i45 %A, 2 ; [#uses=1] ret i45 %V } +; CHECK: @test15a +; CHECK-NOT: sh define i53 @test15a(i1 %X) { %A = select i1 %X, i8 3, i8 1 ; [#uses=1] %B = zext i8 %A to i53 ; [#uses=1] @@ -112,6 +147,8 @@ define i53 @test15a(i1 %X) { ret i53 %V } +; CHECK: @test16 +; CHECK-NOT: sh define i1 @test16(i84 %X) { %tmp.3 = ashr i84 %X, 4 ; [#uses=1] %tmp.6 = and i84 %tmp.3, 1 ; [#uses=1] @@ -119,48 +156,64 @@ define i1 @test16(i84 %X) { ret i1 %tmp.7 } +; CHECK: @test17 +; CHECK-NOT: sh define i1 @test17(i106 %A) { %B = lshr i106 %A, 3 ; [#uses=1] %C = icmp eq i106 %B, 1234 ; [#uses=1] ret i1 %C } +; CHECK: @test18 +; CHECK-NOT: sh define i1 @test18(i11 %A) { %B = lshr i11 %A, 10 ; [#uses=1] %C = icmp eq i11 %B, 123 ; [#uses=1] ret i1 %C } +; CHECK: @test19 +; CHECK-NOT: sh define i1 @test19(i37 %A) { %B = ashr i37 %A, 2 ; [#uses=1] %C = icmp eq i37 %B, 0 ; [#uses=1] ret i1 %C } +; CHECK: @test19a +; CHECK-NOT: sh define i1 @test19a(i39 %A) { %B = ashr i39 %A, 2 ; [#uses=1] %C = icmp eq i39 %B, -1 ; [#uses=1] ret i1 %C } +; CHECK: @test20 +; CHECK-NOT: sh define i1 @test20(i13 %A) { %B = ashr i13 %A, 12 ; [#uses=1] %C = icmp eq i13 %B, 123 ; [#uses=1] ret i1 %C } +; CHECK: @test21 +; CHECK-NOT: sh define i1 @test21(i12 %A) { %B = shl i12 %A, 6 ; [#uses=1] %C = icmp eq i12 %B, -128 ; [#uses=1] ret i1 %C } +; CHECK: @test22 +; CHECK-NOT: sh define i1 @test22(i14 %A) { %B = shl i14 %A, 7 ; [#uses=1] %C = icmp eq i14 %B, 0 ; [#uses=1] ret i1 %C } +; CHECK: @test23 +; CHECK-NOT: sh define i11 @test23(i44 %A) { %B = shl i44 %A, 33 ; [#uses=1] %C = ashr i44 %B, 33 ; [#uses=1] @@ -168,6 +221,8 @@ define i11 @test23(i44 %A) { ret i11 %D } +; CHECK: @test25 +; CHECK-NOT: sh define i37 @test25(i37 %tmp.2, i37 %AA) { %x = lshr i37 %AA, 17 ; [#uses=1] %tmp.3 = lshr i37 %tmp.2, 17 ; [#uses=1] @@ -176,6 +231,8 @@ define i37 @test25(i37 %tmp.2, i37 %AA) { ret i37 %tmp.6 } +; CHECK: @test26 +; CHECK-NOT: sh define i40 @test26(i40 %A) { %B = lshr i40 %A, 1 ; [#uses=1] %C = bitcast i40 %B to i40 ; [#uses=1] -- 2.11.0