[llvm-commits] [llvm] r83825 - in /llvm/trunk/test/Transforms/InstCombine: 2004-11-27-SetCCForCastLargerAndConstant.ll 2006-04-28-ShiftShiftLongLong.ll 2008-01-21-MismatchedCastAndCompare.ll 2008-01-21-MulTrunc.ll zext.ll

Edward O'Callaghan eocallaghan at auroraux.org
Sun Oct 11 23:14:06 PDT 2009


Author: evocallaghan
Date: Mon Oct 12 01:14:06 2009
New Revision: 83825

URL: http://llvm.org/viewvc/llvm-project?rev=83825&view=rev
Log:
Convert InstCombine tests from notcast to FileCheck.

Modified:
    llvm/trunk/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
    llvm/trunk/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll
    llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
    llvm/trunk/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll
    llvm/trunk/test/Transforms/InstCombine/zext.ll

Modified: llvm/trunk/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll?rev=83825&r1=83824&r2=83825&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Mon Oct 12 01:14:06 2009
@@ -9,124 +9,152 @@
 ; be eliminated. In many cases the setCC is also eliminated based on the
 ; constant value and the range of the casted value.
 ;
-; RUN: opt < %s -instcombine -S | \
-; RUN:    notcast .*int
+; RUN: opt < %s -instcombine -S | FileCheck %s
 ; END.
 define i1 @lt_signed_to_large_unsigned(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp ult i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C1 = icmp sgt i8 %SB, -1
+; CHECK: ret i1 %C1
 }
 
 define i1 @lt_signed_to_large_signed(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 true
 }
 
 define i1 @lt_signed_to_large_negative(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, -1024             ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 false
 }
 
 define i1 @lt_signed_to_small_signed(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, 17                ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp slt i8 %SB, 17
+; CHECK: ret i1 %C
 }
 define i1 @lt_signed_to_small_negative(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, -17               ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp slt i8 %SB, -17
+; CHECK: ret i1 %C
 }
 
 define i1 @lt_unsigned_to_large_unsigned(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp ult i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 true
 }
 
 define i1 @lt_unsigned_to_large_signed(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 true
 }
 
 define i1 @lt_unsigned_to_large_negative(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, -1024             ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 false
 }
 
 define i1 @lt_unsigned_to_small_unsigned(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp ult i32 %Y, 17                ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp ult i8 %SB, 17
+; CHECK: ret i1 %C
 }
 
 define i1 @lt_unsigned_to_small_negative(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp slt i32 %Y, -17               ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 false
 }
 
 define i1 @gt_signed_to_large_unsigned(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp ugt i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp slt i8 %SB, 0
+; CHECK: ret i1 %C
 }
 
 define i1 @gt_signed_to_large_signed(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 false
 }
 
 define i1 @gt_signed_to_large_negative(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, -1024             ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 true
 }
+
 define i1 @gt_signed_to_small_signed(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, 17                ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp sgt i8 %SB, 17
+; CHECK: ret i1 %C
 }
 
 define i1 @gt_signed_to_small_negative(i8 %SB) {
         %Y = sext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, -17               ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp sgt i8 %SB, -17
+; CHECK: ret i1 %C
 }
 
 define i1 @gt_unsigned_to_large_unsigned(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp ugt i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 false
 }
 
 define i1 @gt_unsigned_to_large_signed(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, 1024              ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 false
 }
 
 define i1 @gt_unsigned_to_large_negative(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, -1024             ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 true
 }
 
 define i1 @gt_unsigned_to_small_unsigned(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp ugt i32 %Y, 17                ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: %C = icmp ugt i8 %SB, 17
+; CHECK: ret i1 %C
 }
 
 define i1 @gt_unsigned_to_small_negative(i8 %SB) {
         %Y = zext i8 %SB to i32         ; <i32> [#uses=1]
         %C = icmp sgt i32 %Y, -17               ; <i1> [#uses=1]
         ret i1 %C
+; CHECK: ret i1 true
 }
 

Modified: llvm/trunk/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll?rev=83825&r1=83824&r2=83825&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll Mon Oct 12 01:14:06 2009
@@ -1,11 +1,13 @@
-; RUN: opt < %s -instcombine -S | grep shl
-; RUN: opt < %s -instcombine -S | notcast
+; RUN: opt < %s -instcombine -S | FileCheck %s
 
 ; This cannot be turned into a sign extending cast!
 
 define i64 @test(i64 %X) {
         %Y = shl i64 %X, 16             ; <i64> [#uses=1]
+; CHECK: %Y = shl i64 %X, 16
         %Z = ashr i64 %Y, 16            ; <i64> [#uses=1]
+; CHECK: %Z = ashr i64 %Y, 16
         ret i64 %Z
+; CHECK: ret i64 %Z
 }
 

Modified: llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll?rev=83825&r1=83824&r2=83825&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll Mon Oct 12 01:14:06 2009
@@ -1,5 +1,4 @@
-; RUN: opt < %s -instcombine -S | notcast
-; RUN: opt < %s -instcombine -S | not grep {icmp s}
+; RUN: opt < %s -instcombine -S | FileCheck %s
 ; PR1940
 
 define i1 @test1(i8 %A, i8 %B) {
@@ -7,6 +6,8 @@
         %b = zext i8 %B to i32
         %c = icmp sgt i32 %a, %b
         ret i1 %c
+; CHECK: %c = icmp ugt i8 %A, %B
+; CHECK: ret i1 %c
 }
 
 define i1 @test2(i8 %A, i8 %B) {
@@ -14,4 +15,6 @@
         %b = sext i8 %B to i32
         %c = icmp ugt i32 %a, %b
         ret i1 %c
+; CHECK: %c = icmp ugt i8 %A, %B
+; CHECK: ret i1 %c
 }

Modified: llvm/trunk/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll?rev=83825&r1=83824&r2=83825&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll Mon Oct 12 01:14:06 2009
@@ -1,11 +1,15 @@
-; RUN: opt < %s -instcombine -S | notcast
+; RUN: opt < %s -instcombine -S | FileCheck %s
 
 define i16 @test1(i16 %a) {
         %tmp = zext i16 %a to i32               ; <i32> [#uses=2]
         %tmp21 = lshr i32 %tmp, 8               ; <i32> [#uses=1]
+; CHECK: %tmp21 = lshr i16 %a, 8
         %tmp5 = mul i32 %tmp, 5         ; <i32> [#uses=1]
+; CHECK: %tmp5 = mul i16 %a, 5
         %tmp.upgrd.32 = or i32 %tmp21, %tmp5            ; <i32> [#uses=1]
+; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5
         %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16           ; <i16> [#uses=1]
         ret i16 %tmp.upgrd.3
+; CHECK: ret i16 %tmp.upgrd.32
 }
 

Modified: llvm/trunk/test/Transforms/InstCombine/zext.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/zext.ll?rev=83825&r1=83824&r2=83825&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/zext.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/zext.ll Mon Oct 12 01:14:06 2009
@@ -1,11 +1,13 @@
 ; Tests to make sure elimination of casts is working correctly
-; RUN: opt < %s -instcombine -S | \
-; RUN:   notcast {} {%c1.*}
+; RUN: opt < %s -instcombine -S | FileCheck %s
 
 define i64 @test_sext_zext(i16 %A) {
         %c1 = zext i16 %A to i32                ; <i32> [#uses=1]
         %c2 = sext i32 %c1 to i64               ; <i64> [#uses=1]
         ret i64 %c2
+CHECK-NOT: %c1
+CHECK: %c2 = zext i16 %A to i64
+CHECK: ret i64 %c2
 }
 
 ; PR3599
@@ -29,5 +31,6 @@
 	%tmp16 = or i32 %tmp15, %tmp6		; <i32> [#uses=1]
 	%tmp17 = or i32 %tmp16, %tmp3		; <i32> [#uses=1]
 	ret i32 %tmp17
+CHECK: ret i1 true
 }
 





More information about the llvm-commits mailing list