OSDN Git Service

[IndVars] Un-grepify test; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 3 Aug 2016 20:53:23 +0000 (20:53 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 3 Aug 2016 20:53:23 +0000 (20:53 +0000)
Some of these tests need to be cleaned up further to make it obvious
what they're testing, but as a first step remove all instances of
"grep".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277648 91177308-0d34-0410-b5e6-96231b3b80d8

24 files changed:
test/Transforms/IndVarSimplify/2005-02-26-ExitValueCompute.ll
test/Transforms/IndVarSimplify/2006-03-31-NegativeStride.ll
test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll
test/Transforms/IndVarSimplify/2008-09-02-IVType.ll
test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll
test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll
test/Transforms/IndVarSimplify/ashr-tripcount.ll
test/Transforms/IndVarSimplify/eliminate-max.ll
test/Transforms/IndVarSimplify/exit_value_tests.ll
test/Transforms/IndVarSimplify/lftr-promote.ll
test/Transforms/IndVarSimplify/lftr_simple.ll
test/Transforms/IndVarSimplify/loop_evaluate10.ll
test/Transforms/IndVarSimplify/loop_evaluate8.ll
test/Transforms/IndVarSimplify/loop_evaluate9.ll
test/Transforms/IndVarSimplify/loop_evaluate_2.ll
test/Transforms/IndVarSimplify/loop_evaluate_3.ll
test/Transforms/IndVarSimplify/loop_evaluate_4.ll
test/Transforms/IndVarSimplify/loop_evaluate_5.ll
test/Transforms/IndVarSimplify/loop_evaluate_6.ll
test/Transforms/IndVarSimplify/masked-iv.ll
test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
test/Transforms/IndVarSimplify/shrunk-constant.ll
test/Transforms/IndVarSimplify/signed-trip-count.ll
test/Transforms/IndVarSimplify/uglygep.ll

index edeead1..0c48a63 100644 (file)
@@ -1,7 +1,8 @@
-; RUN: opt < %s -indvars -S | \
-; RUN:   grep "ret i32 152"
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 define i32 @main() {
+; CHECK-LABEL: @main(
+; CHECK: ret i32 152
 entry:
         br label %no_exit
 
index c4e6cd4..c5e95ba 100644 (file)
@@ -1,10 +1,11 @@
 ; PR726
-; RUN: opt < %s -indvars -S | \
-; RUN:   grep "ret i32 27"
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; Make sure to compute the right exit value based on negative strides.
 
 define i32 @test() {
+; CHECK-LABEL: @test(
+; CHECK: ret i32 27
 entry:
         br label %cond_true
 
index 3dda657..e6986ca 100644 (file)
@@ -1,5 +1,5 @@
 ; PR1015
-; RUN: opt < %s -indvars -S | not grep "ret i32 0"
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 target datalayout = "e-p:32:32"
 target triple = "i686-apple-darwin8"
@@ -8,6 +8,8 @@ target triple = "i686-apple-darwin8"
 
 
 define i32 @test(i32 %J) {
+; CHECK-LABEL: @test(
+; CHECK-NOT: ret i32 0
 entry:
        br label %bb2
 
index 58934f5..a5669c5 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -indvars -S | grep sext | count 1
+; RUN: opt < %s -indvars -S | FileCheck %s
 ; ModuleID = '<stdin>'
 
 ; Provide legal integer types.
@@ -21,6 +21,9 @@ target datalayout = "n8:16:32:64"
 @llvm.used = appending global [1 x i8*] [ i8* bitcast (i16 (%struct.JPEGGlobals*)* @ExtractBufferedBlocksIgnored to i8*) ], section "llvm.metadata"            ; <[1 x i8*]*> [#uses=0]
 
 define signext i16 @ExtractBufferedBlocksIgnored(%struct.JPEGGlobals* %globp)  nounwind {
+; CHECK-LABEL: @ExtractBufferedBlocksIgnored(
+; CHECK: sext
+; CHECK-NOT: sext
 entry:
        %tmp4311 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 70                ; <i32*> [#uses=1]
        %tmp4412 = load i32, i32* %tmp4311, align 16            ; <i32> [#uses=2]
index ab2af32..9226088 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -indvars -S | not grep "sext"
+; RUN: opt < %s -indvars -S | FileCheck %s
 ; ModuleID = '<stdin>'
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n32:64"
 target triple = "x86_64-apple-darwin9.6"
@@ -10,6 +10,8 @@ target triple = "x86_64-apple-darwin9.6"
 @f = external global i32*              ; <i32**> [#uses=3]
 
 define void @foo() nounwind {
+; CHECK-LABEL: @foo(
+; CHECK-NOT: sext
 bb1.thread:
        br label %bb1
 
index 921a393..67a971a 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -indvars -instcombine -S | not grep "[sz]ext"
+; RUN: opt < %s -indvars -instcombine -S | FileCheck %s
 ; ModuleID = '<stdin>'
 ;extern int *a, *b, *c, *d, *e, *f;  /* 64 bit */
 ;extern int K[256];
@@ -24,6 +24,9 @@ target triple = "x86_64-apple-darwin9.6"
 @K = external global [256 x i32]               ; <[256 x i32]*> [#uses=3]
 
 define void @foo() nounwind {
+; CHECK-LABEL: @foo(
+; CHECK-NOT: sext
+; CHECK-NOT: zext
 bb1.thread:
        br label %bb1
 
index 5f33730..19065db 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: grep sext %t | count 1
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; Indvars should be able to eliminate all of the sign extensions
 ; inside the loop.
@@ -11,6 +10,9 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 @i_pow_2_025_tab = external constant [0 x float]               ; <[0 x float]*> [#uses=1]
 
 define void @foo(i32 %gain, i32 %noOfLines, i32* %quaSpectrum, float* %iquaSpectrum, float* %pow4_3_tab_ptr) nounwind {
+; CHECK-LABEL: @foo(
+; CHECK: sext
+; CHECK-NOT: sext
 entry:
        %t0 = icmp slt i32 %gain, 0             ; <i1> [#uses=1]
        br i1 %t0, label %bb1, label %bb2
index 5831b93..6d07c2c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -S -indvars | grep "= icmp" | count 3
+; RUN: opt < %s -S -indvars | FileCheck %s
 ; PR4914.ll
 
 ; Indvars should be able to do range analysis and eliminate icmps.
 @0 = private constant [4 x i8] c"%d\0A\00", align 1 ; <[4 x i8]*> [#uses=1]
 
 define i32 @main() nounwind {
+; CHECK-LABEL: @main(
+; CHECK: = icmp
+; CHECK: = icmp
+; CHECK: = icmp
+; CHECK-NOT: = icmp
 bb:
   br label %bb1
 
index 737e733..e491524 100644 (file)
@@ -2,8 +2,9 @@
 ; these loops all have predictable exit values we can replace the use outside
 ; of the loop with a closed-form computation, making the loop dead.
 ;
-; RUN: opt < %s -indvars -loop-deletion -simplifycfg | \
-; RUN:   llvm-dis | not grep br
+; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | FileCheck %s
+
+; CHECK-NOT: br
 
 define i32 @polynomial_constant() {
 ; <label>:0
index 4fe3191..52e1ea9 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -indvars -S | grep add | count 1
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; Indvars should be able to compute the exit value of this loop
 ; without any additional arithmetic. The only add needed should
@@ -7,6 +7,10 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 
 define void @foo(double* %p, i32 %n) nounwind {
+; CHECK-LABEL: @foo(
+; CHECK: add
+; CHECK-NOT: add
+
 entry:
        %0 = icmp sgt i32 %n, 0         ; <i1> [#uses=1]
        br i1 %0, label %bb.nph, label %return
index 6a8d937..ee6470a 100644 (file)
@@ -1,6 +1,6 @@
 ; LFTR should eliminate the need for the computation of i*i completely.  It
 ; is only used to compute the exit value.
-; RUN: opt < %s -indvars -dce -S | not grep mul
+; RUN: opt < %s -indvars -dce -S | FileCheck %s
 
 ; Provide legal integer types.
 target datalayout = "n8:16:32:64"
@@ -9,6 +9,8 @@ target datalayout = "n8:16:32:64"
 @A = external global i32                ; <i32*> [#uses=1]
 
 define i32 @quadratic_setlt() {
+; CHECK-LABEL: @quadratic_setlt(
+; CHECK-NOT: mul
 entry:
         br label %loop
 
index bb33a64..0739219 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: opt < %s -indvars -S \
-; RUN:   | grep "%b.1 = phi i32 [ 2, %bb ], [ 1, %bb2 ]"
+; RUN: opt < %s -indvars -S | FileCheck %s
 ;
 ; This loop has multiple exits, and the value of %b1 depends on which
 ; exit is taken. Indvars should correctly compute the exit values.
@@ -15,6 +14,8 @@ target triple = "x86_64-pc-linux-gnu"
        %struct..0anon = type <{ i8, [3 x i8] }>
 
 define i32 @main() nounwind {
+; CHECK-LABEL: @main(
+; CHECK: %b.1 = phi i32 [ 2, %bb ], [ 1, %bb2 ]
 entry:
        br label %bb2
 
index 28d05df..fef1bd6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -indvars -S | not grep select
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; This loop has backedge-taken-count zero. Indvars shouldn't expand any
 ; instructions to compute a trip count.
@@ -7,6 +7,8 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
 target triple = "i386-pc-linux-gnu"
 
 define i8* @string_expandtabs() nounwind {
+; CHECK-LABEL: @string_expandtabs(
+; CHECK-NOT: select
 entry:
        br i1 undef, label %bb33, label %bb1
 
index 7a69bd2..96f2f30 100644 (file)
@@ -1,6 +1,4 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: grep "[%]tmp7 = icmp eq i8 -28, -28" %t
-; RUN: grep "[%]tmp8 = icmp eq i8 63, 63" %t
+; RUN: opt < %s -indvars -S | FileCheck %s
 ; PR4477
 ; Indvars should compute the exit values in loop.
 ;
@@ -16,6 +14,10 @@ target triple = "i386-pc-linux-gnu"
 @.str = internal constant [13 x i8] c"fc70a00.adb\00\00", align 1              ; <[13 x i8]*> [#uses=1]
 
 define void @_ada_cc70a02() {
+; CHECK-LABEL: @_ada_cc70a02(
+; CHECK: [%]tmp7 = icmp eq i8 -28, -28
+; CHECK: [%]tmp8 = icmp eq i8 63, 63
+
 entry:
        br label %bb1.i
 
index c0099a8..930819e 100644 (file)
@@ -1,7 +1,8 @@
-; RUN: opt < %s -indvars -loop-deletion -simplifycfg | opt \
-; RUN:     -analyze -loops | not grep "^Loop Containing" 
+; RUN: opt < %s -indvars -loop-deletion -simplifycfg | opt -analyze -loops | FileCheck %s
 ; PR1179
 
+; CHECK-NOT: Loop Containing
+
 define i32 @ltst(i32 %x) {
 entry:
         icmp sgt i32 %x, 0              ; <i1>:0 [#uses=1]
index 0c1b590..1ce7b55 100644 (file)
@@ -1,7 +1,9 @@
-; RUN: opt < %s -indvars -S | grep "ret i32 600000"
+; RUN: opt < %s -indvars -S | FileCheck %s
 ; PR1179
 
 define i32 @foo() {
+; CHECK-LABEL: @foo(
+; CHECK: ret i32 600000
 entry:
         br label %bb5
 
index d7eb406..0bdae11 100644 (file)
@@ -1,7 +1,9 @@
-; RUN: opt < %s -indvars -S | grep "ret i32 9900"
+; RUN: opt < %s -indvars -S | FileCheck %s
 ; PR1179
 
 define i32 @test4() {
+; CHECK-LABEL: @test4(
+; CHECK: ret i32 9900
 entry:
         br label %bb7
 
index 38f95bf..0a601b4 100644 (file)
@@ -1,10 +1,12 @@
-; RUN: opt < %s -indvars -S | grep "120, %bb2.bb3_crit_edge"
+; RUN: opt < %s -indvars -S | FileCheck %s
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
 target triple = "i686-pc-linux-gnu"
 
 ; Indvars should be able to compute an exit value for %tmp1.
 
 define i32 @testcase(i5 zeroext %k) nounwind readnone {
+; CHECK-LABEL: @testcase
+; CHECK: 120, %bb2.bb3_crit_edge
 entry:
        br i1 false, label %bb3, label %bb.nph
 
index af01fe5..fd49674 100644 (file)
@@ -1,6 +1,10 @@
-; RUN: opt < %s -indvars -loop-deletion -S | grep phi | count 1
+; RUN: opt < %s -indvars -loop-deletion -S | FileCheck %s
 
 define i32 @test(i32 %x_offs) nounwind readnone {
+; CHECK-LABEL: @test(
+; CHECK: phi
+; CHECK-NOT: phi
+
 entry:
        %0 = icmp sgt i32 %x_offs, 4            ; <i1> [#uses=1]
        br i1 %0, label %bb.nph, label %bb2
index 24fe33d..c045469 100644 (file)
@@ -1,11 +1,13 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: not grep trunc %t
-; RUN: grep and %t | count 1
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; Indvars should do the IV arithmetic in the canonical IV type (i64),
 ; and only use one truncation.
 
 define void @foo(i64* %A, i64* %B, i64 %n, i64 %a, i64 %s) nounwind {
+; CHECK-LABEL: @foo(
+; CHECK-NOT: trunc
+; CHECK: and
+; CHECK-NOT: and
 entry:
        %t0 = icmp sgt i64 %n, 0                ; <i1> [#uses=1]
        br i1 %t0, label %bb.preheader, label %return
index f2afaf4..956999b 100644 (file)
@@ -1,8 +1,9 @@
-; RUN: opt < %s -indvars -S | not grep sext
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; Provide legal integer types.
 target datalayout = "n8:16:32:64"
 
+; CHECK-NOT: sext
 
 define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly {
 entry:
index 45297d6..477c86b 100644 (file)
@@ -1,5 +1,6 @@
-; RUN: opt < %s -scalar-evolution -analyze \
-; RUN:  | grep "\-->  (zext i4 {-7,+,-8}<%loop> to i32)"
+; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
+
+; CHECK: -->  (zext i4 {-7,+,-8}<%loop> to i32)
 
 define fastcc void @foo() nounwind {
 entry:
index 992e22e..41968ac 100644 (file)
@@ -1,12 +1,14 @@
-; RUN: opt < %s -indvars -S > %t
-; RUN: not grep sext %t
-; RUN: grep phi %t | count 1
+; RUN: opt < %s -indvars -S | FileCheck %s
 
 ; Provide legal integer types.
 target datalayout = "n8:16:32:64"
 
 
 define void @foo(i64* nocapture %x, i32 %n) nounwind {
+; CHECK-LABEL: @foo(
+; CHECK-NOT: sext
+; CHECK: phi
+; CHECK-NOT: phi
 entry:
        %tmp102 = icmp sgt i32 %n, 0            ; <i1> [#uses=1]
        br i1 %tmp102, label %bb.nph, label %return
index e434389..4ee231f 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt -indvars -S < %s | not grep uglygep
+; RUN: opt -indvars -S < %s | FileCheck %s
 ; rdar://8197217
 
 ; Indvars should be able to emit a clean GEP here, not an uglygep.
@@ -11,6 +11,8 @@ target triple = "x86_64-apple-darwin11.0"
 @tds = external global double**                   ; <double***> [#uses=1]
 
 define void @init_td(i32 %tmp7) nounwind {
+; CHECK-LABEL: @init_td
+; CHECK-NOT: uglygep
 entry:
   br label %bb4