[SCEV] Un-grep'ify tests; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 5 Aug 2016 20:33:49 +0000 (20:33 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 5 Aug 2016 20:33:49 +0000 (20:33 +0000)
llvm-svn: 277861

llvm/test/Analysis/ScalarEvolution/sext-inreg.ll
llvm/test/Analysis/ScalarEvolution/trip-count5.ll

index 8f1d5bd..2201d63 100644 (file)
@@ -1,28 +1,33 @@
-; RUN: opt < %s -analyze -scalar-evolution > %t
-; RUN: grep "sext i57 {0,+,199}<%bb> to i64" %t | count 1
-; RUN: grep "sext i59 {0,+,199}<%bb> to i64" %t | count 1
+; RUN: opt < %s -analyze -scalar-evolution | 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-f80:128:128"
 target triple = "i386-apple-darwin9.6"
 
 define i64 @foo(i64* nocapture %x, i64 %n) nounwind {
+; CHECK-LABEL: Classifying expressions for: @foo
 entry:
-       %t0 = icmp sgt i64 %n, 0                ; <i1> [#uses=1]
+       %t0 = icmp sgt i64 %n, 0
        br i1 %t0, label %bb, label %return
 
-bb:            ; preds = %bb, %entry
-       %i.01 = phi i64 [ 0, %entry ], [ %indvar.next, %bb ]            ; <i32> [#uses=2]
-       %t1 = shl i64 %i.01, 7          ; <i32> [#uses=1]
-       %t2 = ashr i64 %t1, 7           ; <i32> [#uses=1]
-       %s1 = shl i64 %i.01, 5          ; <i32> [#uses=1]
-       %s2 = ashr i64 %s1, 5           ; <i32> [#uses=1]
-       %t3 = getelementptr i64, i64* %x, i64 %i.01             ; <i64*> [#uses=1]
+bb:
+       %i.01 = phi i64 [ 0, %entry ], [ %indvar.next, %bb ]
+       %t1 = shl i64 %i.01, 7
+       %t2 = ashr i64 %t1, 7
+; CHECK: %t2 = ashr i64 %t1, 7
+; CHECK-NEXT: sext i57 {0,+,199}<%bb> to i64
+; CHECK-NOT: i57
+; CHECK: %s2 = ashr i64 %s1, 5
+; CHECK-NEXT: sext i59 {0,+,199}<%bb> to i64
+; CHECK-NOT: i59
+       %s1 = shl i64 %i.01, 5
+       %s2 = ashr i64 %s1, 5
+       %t3 = getelementptr i64, i64* %x, i64 %i.01
        store i64 0, i64* %t3, align 1
-       %indvar.next = add i64 %i.01, 199               ; <i32> [#uses=2]
-       %exitcond = icmp eq i64 %indvar.next, %n                ; <i1> [#uses=1]
+       %indvar.next = add i64 %i.01, 199
+       %exitcond = icmp eq i64 %indvar.next, %n
        br i1 %exitcond, label %return, label %bb
 
-return:                ; preds = %bb, %entry
+return:
         %p = phi i64 [ 0, %entry ], [ %t2, %bb ]
         %q = phi i64 [ 0, %entry ], [ %s2, %bb ]
         %v = xor i64 %p, %q
index dc02fed..f3ca343 100644 (file)
@@ -1,6 +1,4 @@
-; RUN: opt < %s -analyze -scalar-evolution > %t
-; RUN: grep sext %t | count 2
-; RUN: not grep "(sext" %t
+; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
 
 ; ScalarEvolution should be able to compute a maximum trip count
 ; value sufficient to fold away both sext casts.
@@ -8,41 +6,46 @@
 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 float @t(float* %pTmp1, float* %peakWeight, float* %nrgReducePeakrate, i32 %bim) nounwind {
+; CHECK-LABEL: Classifying expressions for: @t
 entry:
-       %tmp3 = load float, float* %peakWeight, align 4         ; <float> [#uses=2]
-       %tmp2538 = icmp sgt i32 %bim, 0         ; <i1> [#uses=1]
+       %tmp3 = load float, float* %peakWeight, align 4
+       %tmp2538 = icmp sgt i32 %bim, 0
        br i1 %tmp2538, label %bb.nph, label %bb4
 
-bb.nph:                ; preds = %entry
+bb.nph:
        br label %bb
 
-bb:            ; preds = %bb1, %bb.nph
-       %distERBhi.036 = phi float [ %tmp10, %bb1 ], [ 0.000000e+00, %bb.nph ]          ; <float> [#uses=1]
-       %hiPart.035 = phi i32 [ %tmp12, %bb1 ], [ 0, %bb.nph ]          ; <i32> [#uses=2]
-       %peakCount.034 = phi float [ %tmp19, %bb1 ], [ %tmp3, %bb.nph ]         ; <float> [#uses=1]
-       %tmp6 = sext i32 %hiPart.035 to i64             ; <i64> [#uses=1]
-       %tmp7 = getelementptr float, float* %pTmp1, i64 %tmp6           ; <float*> [#uses=1]
-       %tmp8 = load float, float* %tmp7, align 4               ; <float> [#uses=1]
-       %tmp10 = fadd float %tmp8, %distERBhi.036               ; <float> [#uses=3]
-       %tmp12 = add i32 %hiPart.035, 1         ; <i32> [#uses=3]
-       %tmp15 = sext i32 %tmp12 to i64         ; <i64> [#uses=1]
-       %tmp16 = getelementptr float, float* %peakWeight, i64 %tmp15            ; <float*> [#uses=1]
-       %tmp17 = load float, float* %tmp16, align 4             ; <float> [#uses=1]
-       %tmp19 = fadd float %tmp17, %peakCount.034              ; <float> [#uses=2]
+bb:
+       %distERBhi.036 = phi float [ %tmp10, %bb1 ], [ 0.000000e+00, %bb.nph ]
+       %hiPart.035 = phi i32 [ %tmp12, %bb1 ], [ 0, %bb.nph ]
+       %peakCount.034 = phi float [ %tmp19, %bb1 ], [ %tmp3, %bb.nph ]
+       %tmp6 = sext i32 %hiPart.035 to i64
+       %tmp7 = getelementptr float, float* %pTmp1, i64 %tmp6
+; CHECK:  %tmp6 = sext i32 %hiPart.035 to i64
+; CHECK-NEXT:  -->  {0,+,1}<nuw><nsw><%bb>
+       %tmp8 = load float, float* %tmp7, align 4
+       %tmp10 = fadd float %tmp8, %distERBhi.036
+       %tmp12 = add i32 %hiPart.035, 1
+       %tmp15 = sext i32 %tmp12 to i64
+       %tmp16 = getelementptr float, float* %peakWeight, i64 %tmp15
+; CHECK:  %tmp15 = sext i32 %tmp12 to i64
+; CHECK-NEXT:  -->  {1,+,1}<nuw><nsw><%bb>
+       %tmp17 = load float, float* %tmp16, align 4
+       %tmp19 = fadd float %tmp17, %peakCount.034
        br label %bb1
 
-bb1:           ; preds = %bb
-       %tmp21 = fcmp olt float %tmp10, 2.500000e+00            ; <i1> [#uses=1]
-       %tmp25 = icmp slt i32 %tmp12, %bim              ; <i1> [#uses=1]
-       %tmp27 = and i1 %tmp21, %tmp25          ; <i1> [#uses=1]
+bb1:
+       %tmp21 = fcmp olt float %tmp10, 2.500000e+00
+       %tmp25 = icmp slt i32 %tmp12, %bim
+       %tmp27 = and i1 %tmp21, %tmp25
        br i1 %tmp27, label %bb, label %bb1.bb4_crit_edge
 
-bb1.bb4_crit_edge:             ; preds = %bb1
+bb1.bb4_crit_edge:
        br label %bb4
 
-bb4:           ; preds = %bb1.bb4_crit_edge, %entry
-       %distERBhi.0.lcssa = phi float [ %tmp10, %bb1.bb4_crit_edge ], [ 0.000000e+00, %entry ]         ; <float> [#uses=1]
-       %peakCount.0.lcssa = phi float [ %tmp19, %bb1.bb4_crit_edge ], [ %tmp3, %entry ]                ; <float> [#uses=1]
-       %tmp31 = fdiv float %peakCount.0.lcssa, %distERBhi.0.lcssa              ; <float> [#uses=1]
+bb4:
+       %distERBhi.0.lcssa = phi float [ %tmp10, %bb1.bb4_crit_edge ], [ 0.000000e+00, %entry ]
+       %peakCount.0.lcssa = phi float [ %tmp19, %bb1.bb4_crit_edge ], [ %tmp3, %entry ]
+       %tmp31 = fdiv float %peakCount.0.lcssa, %distERBhi.0.lcssa
        ret float %tmp31
 }