diff --git a/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll b/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll index e0c5583cbb9..b5eb9fc4878 100644 --- a/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll +++ b/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll @@ -1,9 +1,10 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: -scalar-evolution-max-iterations=0 | grep "Loop %bb: backedge-taken count is 100" +; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s ; PR1533 @array = weak global [101 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1] +; CHECK: Loop %bb: backedge-taken count is 100 + define void @loop(i32 %x) { entry: br label %bb diff --git a/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll b/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll index e946d7a64bc..2cb8c5bf46f 100644 --- a/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll +++ b/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll @@ -1,5 +1,4 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: -scalar-evolution-max-iterations=0 | FileCheck %s +; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s ; PR1101 diff --git a/test/Analysis/ScalarEvolution/smax.ll b/test/Analysis/ScalarEvolution/smax.ll index eceb4298fd5..122e9e47e56 100644 --- a/test/Analysis/ScalarEvolution/smax.ll +++ b/test/Analysis/ScalarEvolution/smax.ll @@ -1,8 +1,10 @@ -; RUN: opt < %s -analyze -scalar-evolution | grep smax | count 2 -; RUN: opt < %s -analyze -scalar-evolution | grep \ -; RUN: "%. smax %. smax %." +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s ; PR1614 +; CHECK: --> (%a smax %b) +; CHECK: --> (%a smax %b smax %c) +; CHECK-NOT: smax + define i32 @x(i32 %a, i32 %b, i32 %c) { %A = icmp sgt i32 %a, %b %B = select i1 %A, i32 %a, i32 %b diff --git a/test/Analysis/ScalarEvolution/trip-count.ll b/test/Analysis/ScalarEvolution/trip-count.ll index 94f6882c0c9..f89125aeb29 100644 --- a/test/Analysis/ScalarEvolution/trip-count.ll +++ b/test/Analysis/ScalarEvolution/trip-count.ll @@ -1,9 +1,9 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 10000" +; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s ; PR1101 @A = weak global [1000 x i32] zeroinitializer, align 32 +; CHECK: backedge-taken count is 10000 define void @test(i32 %N) { entry: diff --git a/test/Analysis/ScalarEvolution/trip-count2.ll b/test/Analysis/ScalarEvolution/trip-count2.ll index d84e99f6e7c..e76488abfca 100644 --- a/test/Analysis/ScalarEvolution/trip-count2.ll +++ b/test/Analysis/ScalarEvolution/trip-count2.ll @@ -1,9 +1,9 @@ -; RUN: opt < %s -analyze -scalar-evolution | \ -; RUN: grep "backedge-taken count is 4" +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s ; PR1101 @A = weak global [1000 x i32] zeroinitializer, align 32 +; CHECK: backedge-taken count is 4 define void @test(i32 %N) { entry: diff --git a/test/Analysis/ScalarEvolution/trip-count3.ll b/test/Analysis/ScalarEvolution/trip-count3.ll index 0cb6c952b89..32c51bfc451 100644 --- a/test/Analysis/ScalarEvolution/trip-count3.ll +++ b/test/Analysis/ScalarEvolution/trip-count3.ll @@ -1,10 +1,11 @@ -; RUN: opt < %s -scalar-evolution -analyze \ -; RUN: | grep "Loop %bb3\.i: Unpredictable backedge-taken count\." +; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s ; ScalarEvolution can't compute a trip count because it doesn't know if ; dividing by the stride will have a remainder. This could theoretically ; be teaching it how to use a more elaborate trip count computation. +; CHECK: Loop %bb3.i: Unpredictable backedge-taken count. + %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] } %struct.SHA_INFO = type { [5 x i32], i32, i32, [16 x i32] } %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } diff --git a/test/Analysis/ScalarEvolution/trip-count4.ll b/test/Analysis/ScalarEvolution/trip-count4.ll index c02ae145268..b7184a48fe8 100644 --- a/test/Analysis/ScalarEvolution/trip-count4.ll +++ b/test/Analysis/ScalarEvolution/trip-count4.ll @@ -1,8 +1,9 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: | grep "sext.*trunc.*Exits: 11" +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s ; ScalarEvolution should be able to compute a loop exit value for %indvar.i8. +; CHECK: sext{{.*}}trunc{{.*}}Exits: 11 + define void @another_count_down_signed(double* %d, i64 %n) nounwind { entry: br label %loop diff --git a/test/Analysis/ScalarEvolution/trip-count6.ll b/test/Analysis/ScalarEvolution/trip-count6.ll index 882f5526da4..0f394a09d15 100644 --- a/test/Analysis/ScalarEvolution/trip-count6.ll +++ b/test/Analysis/ScalarEvolution/trip-count6.ll @@ -1,8 +1,9 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: | grep "max backedge-taken count is 1$" +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s @mode_table = global [4 x i32] zeroinitializer ; <[4 x i32]*> [#uses=1] +; CHECK: max backedge-taken count is 1{{$}} + define i8 @f() { entry: tail call i32 @fegetround( ) ; :0 [#uses=1] diff --git a/test/Analysis/ScalarEvolution/trip-count7.ll b/test/Analysis/ScalarEvolution/trip-count7.ll index 2bcb9e92abc..d01a18a468f 100644 --- a/test/Analysis/ScalarEvolution/trip-count7.ll +++ b/test/Analysis/ScalarEvolution/trip-count7.ll @@ -1,8 +1,9 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: | grep "Loop %bb7.i: Unpredictable backedge-taken count\." +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s 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" +; CHECK: Loop %bb7.i: Unpredictable backedge-taken count. + %struct.complex = type { float, float } %struct.element = type { i32, i32 } %struct.node = type { %struct.node*, %struct.node*, i32 } diff --git a/test/Analysis/ScalarEvolution/trip-count8.ll b/test/Analysis/ScalarEvolution/trip-count8.ll index 005162b7921..a1777bc969c 100644 --- a/test/Analysis/ScalarEvolution/trip-count8.ll +++ b/test/Analysis/ScalarEvolution/trip-count8.ll @@ -1,9 +1,10 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: | grep "Loop %for\.body: backedge-taken count is (-1 + [%]ecx)" +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s ; PR4599 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" +; CHECK: Loop %for.body: backedge-taken count is (-1 + {{%?}}ecx) + define i32 @foo(i32 %ecx) nounwind { entry: %cmp2 = icmp eq i32 %ecx, 0 ; [#uses=1] diff --git a/test/Analysis/ScalarEvolution/xor-and.ll b/test/Analysis/ScalarEvolution/xor-and.ll index 4ab2f39a281..2616ea928a4 100644 --- a/test/Analysis/ScalarEvolution/xor-and.ll +++ b/test/Analysis/ScalarEvolution/xor-and.ll @@ -1,9 +1,10 @@ -; RUN: opt < %s -scalar-evolution -analyze \ -; RUN: | grep "\--> (zext i4 (-8 + (trunc i64 (8 \* %x) to i4)) to i64)" +; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s ; ScalarEvolution shouldn't try to analyze %z into something like ; --> (zext i4 (-1 + (-1 * (trunc i64 (8 * %x) to i4))) to i64) +; CHECK: --> (zext i4 (-8 + (trunc i64 (8 * %x) to i4)) to i64) + define i64 @foo(i64 %x) { %a = shl i64 %x, 3 %t = and i64 %a, 8 diff --git a/test/Analysis/ScalarEvolution/zext-wrap.ll b/test/Analysis/ScalarEvolution/zext-wrap.ll index 38d15ffbd88..104ed41010a 100644 --- a/test/Analysis/ScalarEvolution/zext-wrap.ll +++ b/test/Analysis/ScalarEvolution/zext-wrap.ll @@ -1,5 +1,4 @@ -; RUN: opt < %s -analyze -scalar-evolution \ -; RUN: | FileCheck %s +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s ; PR4569 define i16 @main() nounwind { diff --git a/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll b/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll index 3b5211e5999..bb66e3791fc 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll @@ -1,7 +1,9 @@ -; RUN: opt < %s -tbaa -basicaa -argpromotion -mem2reg -S | not grep alloca +; RUN: opt < %s -tbaa -basicaa -argpromotion -mem2reg -S | FileCheck %s target datalayout = "E-p:64:64:64" +; CHECK: test +; CHECK-NOT: alloca define internal i32 @test(i32* %X, i32* %Y, i32* %Q) { store i32 77, i32* %Q, !tbaa !2 %A = load i32* %X, !tbaa !1 @@ -10,6 +12,8 @@ define internal i32 @test(i32* %X, i32* %Y, i32* %Q) { ret i32 %C } +; CHECK: caller +; CHECK-NOT: alloca define internal i32 @caller(i32* %B, i32* %Q) { %A = alloca i32 store i32 78, i32* %Q, !tbaa !2 @@ -18,6 +22,8 @@ define internal i32 @caller(i32* %B, i32* %Q) { ret i32 %C } +; CHECK: callercaller +; CHECK-NOT: alloca define i32 @callercaller(i32* %Q) { %B = alloca i32 store i32 2, i32* %B, !tbaa !1