[llvm-commits] [llvm] r155432 - /llvm/trunk/test/Analysis/BasicAA/
Bill Wendling
isanbard at gmail.com
Tue Apr 24 02:15:38 PDT 2012
Author: void
Date: Tue Apr 24 04:15:38 2012
New Revision: 155432
URL: http://llvm.org/viewvc/llvm-project?rev=155432&view=rev
Log:
FileCheck-ize these tests. Harden some of them.
Modified:
llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll
llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll
llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll
llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll
llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
llvm/trunk/test/Analysis/BasicAA/byval.ll
llvm/trunk/test/Analysis/BasicAA/cas.ll
llvm/trunk/test/Analysis/BasicAA/empty.ll
llvm/trunk/test/Analysis/BasicAA/full-store-partial-alias.ll
llvm/trunk/test/Analysis/BasicAA/gcsetest.ll
llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll
llvm/trunk/test/Analysis/BasicAA/nocapture.ll
llvm/trunk/test/Analysis/BasicAA/phi-aa.ll
llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll
llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll
llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll
Modified: llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll Tue Apr 24 04:15:38 2012
@@ -2,17 +2,19 @@
; is performed. It is not legal to delete the second load instruction because
; the value computed by the first load instruction is changed by the store.
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep DONOTREMOVE
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
define i32 @test() {
- %A = alloca i32
- store i32 0, i32* %A
- %X = load i32* %A
- %B = bitcast i32* %A to i8*
- %C = getelementptr i8* %B, i64 1
- store i8 1, i8* %C ; Aliases %A
- %Y.DONOTREMOVE = load i32* %A
- %Z = sub i32 %X, %Y.DONOTREMOVE
- ret i32 %Z
+; CHECK: %Y.DONOTREMOVE = load i32* %A
+; CHECK: %Z = sub i32 0, %Y.DONOTREMOVE
+ %A = alloca i32
+ store i32 0, i32* %A
+ %X = load i32* %A
+ %B = bitcast i32* %A to i8*
+ %C = getelementptr i8* %B, i64 1
+ store i8 1, i8* %C ; Aliases %A
+ %Y.DONOTREMOVE = load i32* %A
+ %Z = sub i32 %X, %Y.DONOTREMOVE
+ ret i32 %Z
}
Modified: llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll Tue Apr 24 04:15:38 2012
@@ -1,15 +1,14 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep sub
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
define i32 @test(i32 *%Ptr, i64 %V) {
- %P2 = getelementptr i32* %Ptr, i64 1
- %P1 = getelementptr i32* %Ptr, i64 %V
- %X = load i32* %P1
- store i32 5, i32* %P2
-
- %Y = load i32* %P1
-
- %Z = sub i32 %X, %Y
- ret i32 %Z
+; CHECK: sub i32 %X, %Y
+ %P2 = getelementptr i32* %Ptr, i64 1
+ %P1 = getelementptr i32* %Ptr, i64 %V
+ %X = load i32* %P1
+ store i32 5, i32* %P2
+ %Y = load i32* %P1
+ %Z = sub i32 %X, %Y
+ ret i32 %Z
}
Modified: llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll Tue Apr 24 04:15:38 2012
@@ -1,6 +1,9 @@
; In this test, a local alloca cannot alias an incoming argument.
-; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep sub
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
+
+; CHECK: define i32 @test
+; CHECK-NEXT: ret i32 0
define i32 @test(i32* %P) {
%X = alloca i32
Modified: llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll Tue Apr 24 04:15:38 2012
@@ -1,11 +1,13 @@
; This testcase consists of alias relations which should be completely
; resolvable by basicaa.
-; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output \
-; RUN: |& not grep May:
+; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output |& FileCheck %s
%T = type { i32, [10 x i8] }
+; CHECK: Function: test
+; CHECK-NOT: May:
+
define void @test(%T* %P) {
%A = getelementptr %T* %P, i64 0
%B = getelementptr %T* %P, i64 0, i32 0
Modified: llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll Tue Apr 24 04:15:38 2012
@@ -1,13 +1,15 @@
; This testcase consists of alias relations which should be completely
; resolvable by basicaa, but require analysis of getelementptr constant exprs.
-; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output \
-; RUN: |& not grep May:
+; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output |& FileCheck %s
%T = type { i32, [10 x i8] }
@G = external global %T
+; CHECK: Function: test
+; CHECK-NOT: May:
+
define void @test() {
%D = getelementptr %T* @G, i64 0, i32 0
%E = getelementptr %T* @G, i64 0, i32 1, i64 5
Modified: llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll Tue Apr 24 04:15:38 2012
@@ -1,10 +1,11 @@
-; RUN: opt < %s -basicaa -dse -S | grep {store i32 0}
+; RUN: opt < %s -basicaa -dse -S | FileCheck %s
define void @test({i32,i32 }* %P) {
- %Q = getelementptr {i32,i32}* %P, i32 1
- %X = getelementptr {i32,i32}* %Q, i32 0, i32 1
- %Y = getelementptr {i32,i32}* %Q, i32 1, i32 1
- store i32 0, i32* %X
- store i32 1, i32* %Y
- ret void
+; CHECK: store i32 0, i32* %X
+ %Q = getelementptr {i32,i32}* %P, i32 1
+ %X = getelementptr {i32,i32}* %Q, i32 0, i32 1
+ %Y = getelementptr {i32,i32}* %Q, i32 1, i32 1
+ store i32 0, i32* %X
+ store i32 1, i32* %Y
+ ret void
}
Modified: llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll Tue Apr 24 04:15:38 2012
@@ -1,7 +1,9 @@
-; RUN: opt < %s -basicaa -aa-eval -disable-output |& grep {2 no alias respon}
+; RUN: opt < %s -basicaa -aa-eval -disable-output |& FileCheck %s
; TEST that A[1][0] may alias A[0][i].
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
+; CHECK: 2 no alias responses
+
define void @test(i32 %N) {
entry:
%X = alloca [3 x [3 x i32]] ; <[3 x [3 x i32]]*> [#uses=4]
Modified: llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll Tue Apr 24 04:15:38 2012
@@ -1,9 +1,5 @@
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; PR1109
-; RUN: opt < %s -basicaa -gvn -instcombine -S | \
-; RUN: grep {sub i32}
-; RUN: opt < %s -basicaa -gvn -instcombine -S | \
-; RUN: not grep {ret i32 0}
-; END.
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8"
@@ -20,6 +16,9 @@
%struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
%struct.rec = type { %struct.head_type }
+; CHECK: define i32 @test
+; CHECK: %Z = sub i32 %A, %Q
+; CHECK: ret i32 %Z
define i32 @test(%struct.closure_type* %tmp18169) {
%tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <i32*> [#uses=2]
Modified: llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll Tue Apr 24 04:15:38 2012
@@ -1,6 +1,7 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %., i32\\* %.} | grep {%x} | grep {%y}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
-declare i32* @unclear(i32* %a)
+; CHECK: Function: foo
+; CHECK: MayAlias: i32* %x, i32* %y
define void @foo(i32* noalias %x) {
%y = call i32* @unclear(i32* %x)
@@ -8,3 +9,5 @@
store i32 0, i32* %y
ret void
}
+
+declare i32* @unclear(i32* %a)
Modified: llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll Tue Apr 24 04:15:38 2012
@@ -1,6 +1,9 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {9 no alias}
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {6 may alias}
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %Ipointer, i32\\* %Jpointer}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
+
+; CHECK: Function: foo
+; CHECK: MayAlias: i32* %Ipointer, i32* %Jpointer
+; CHECK: 9 no alias responses
+; CHECK: 6 may alias responses
define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
%Ipointer = getelementptr i32* %p, i32 %i
Modified: llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll Tue Apr 24 04:15:38 2012
@@ -1,11 +1,10 @@
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; PR1600
-; RUN: opt < %s -basicaa -gvn -instcombine -S | \
-; RUN: grep {ret i32 0}
-; END.
declare i16 @llvm.cttz.i16(i16, i1)
define i32 @test(i32* %P, i16* %Q) {
+; CHECK: ret i32 0
%A = load i16* %Q ; <i16> [#uses=1]
%x = load i32* %P ; <i32> [#uses=1]
%B = call i16 @llvm.cttz.i16( i16 %A, i1 true ) ; <i16> [#uses=1]
Modified: llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll Tue Apr 24 04:15:38 2012
@@ -1,10 +1,12 @@
-; RUN: opt < %s -basicaa -gvn -dce -S | grep tmp7
+; RUN: opt < %s -basicaa -gvn -dce -S | FileCheck %s
%struct.A = type { i32 }
%struct.B = type { %struct.A }
@a = global %struct.B zeroinitializer ; <%struct.B*> [#uses=2]
define i32 @_Z3fooP1A(%struct.A* %b) {
+; CHECK: %tmp7 = load
+; CHECK: ret i32 %tmp7
entry:
store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8
%tmp4 = getelementptr %struct.A* %b, i32 0, i32 0 ;<i32*> [#uses=1]
Modified: llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll Tue Apr 24 04:15:38 2012
@@ -1,10 +1,11 @@
-; RUN: opt < %s -std-compile-opts -S | grep store
+; RUN: opt < %s -std-compile-opts -S | FileCheck %s
; ModuleID = 'small2.c'
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-darwin8"
%struct.x = type { [4 x i32] }
define void @foo(%struct.x* byval align 4 %X) nounwind {
+; CHECK: store i32 2, i32* %tmp1
entry:
%tmp = getelementptr %struct.x* %X, i32 0, i32 0 ; <[4 x i32]*> [#uses=1]
%tmp1 = getelementptr [4 x i32]* %tmp, i32 0, i32 3 ; <i32*> [#uses=1]
Modified: llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll Tue Apr 24 04:15:38 2012
@@ -1,7 +1,9 @@
-; RUN: opt < %s -basicaa -aa-eval |& grep {1 no alias response}
+; RUN: opt < %s -basicaa -aa-eval -disable-output |& FileCheck %s
declare noalias i32* @_Znwj(i32 %x) nounwind
+; CHECK: 1 no alias response
+
define i32 @foo() {
%A = call i32* @_Znwj(i32 4)
%B = call i32* @_Znwj(i32 4)
Modified: llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll Tue Apr 24 04:15:38 2012
@@ -1,8 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -S | grep load
+; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
declare noalias i32* @noalias()
define i32 @test(i32 %x) {
+; CHECK: load i32* %a
%a = call i32* @noalias()
store i32 1, i32* %a
%b = getelementptr i32* %a, i32 %x
Modified: llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll Tue Apr 24 04:15:38 2012
@@ -1,10 +1,13 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {NoAlias:.*%P,.*@Z}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
; If GEP base doesn't alias Z, then GEP doesn't alias Z.
; rdar://7282591
@Y = common global i32 0
@Z = common global i32 0
+; CHECK: Function: foo
+; CHECK: NoAlias: i32* %P, i32* @Z
+
define void @foo(i32 %cond) nounwind {
entry:
%a = alloca i32
Modified: llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll Tue Apr 24 04:15:38 2012
@@ -1,8 +1,10 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {1 partial alias}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
; PR7959
target datalayout = "e-p:32:32:32"
+; CHECK: 1 partial alias response
+
define i32 @test(i32* %tab, i32 %indvar) nounwind {
%tmp31 = mul i32 %indvar, -2
%tmp32 = add i32 %tmp31, 30
Modified: llvm/trunk/test/Analysis/BasicAA/byval.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/byval.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/byval.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/byval.ll Tue Apr 24 04:15:38 2012
@@ -1,17 +1,17 @@
-; RUN: opt < %s -basicaa -gvn -S | grep {ret i32 1}
+; RUN: opt < %s -basicaa -gvn -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-f80:128:128"
target triple = "i686-apple-darwin8"
%struct.x = type { i32, i32, i32, i32 }
@g = weak global i32 0 ; <i32*> [#uses=1]
define i32 @foo(%struct.x* byval %a) nounwind {
-entry:
- %tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind ; <i32> [#uses=0]
- %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 ; <i32*> [#uses=2]
- store i32 1, i32* %tmp2, align 4
- store i32 2, i32* @g, align 4
- %tmp4 = load i32* %tmp2, align 4 ; <i32> [#uses=1]
- ret i32 %tmp4
+; CHECK: ret i32 1
+ %tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind ; <i32> [#uses=0]
+ %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 ; <i32*> [#uses=2]
+ store i32 1, i32* %tmp2, align 4
+ store i32 2, i32* @g, align 4
+ %tmp4 = load i32* %tmp2, align 4 ; <i32> [#uses=1]
+ ret i32 %tmp4
}
declare i32 @bar(...)
Modified: llvm/trunk/test/Analysis/BasicAA/cas.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/cas.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/cas.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/cas.ll Tue Apr 24 04:15:38 2012
@@ -1,8 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
@flag0 = internal global i32 zeroinitializer
@turn = internal global i32 zeroinitializer
+; CHECK: ret i32 0
define i32 @main() {
%a = load i32* @flag0
Modified: llvm/trunk/test/Analysis/BasicAA/empty.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/empty.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/empty.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/empty.ll Tue Apr 24 04:15:38 2012
@@ -1,8 +1,10 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \
-; RUN: |& grep {NoAlias: \{\}\\* \[%\]p, \{\}\\* \[%\]q}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& 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-n8:16:32:64"
+; CHECK: Function: foo:
+; CHECK-NEXT: NoAlias: {}* %p, {}* %q
+
define void @foo({}* %p, {}* %q) {
store {} {}, {}* %p
store {} {}, {}* %q
Modified: llvm/trunk/test/Analysis/BasicAA/full-store-partial-alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/full-store-partial-alias.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/full-store-partial-alias.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/full-store-partial-alias.ll Tue Apr 24 04:15:38 2012
@@ -1,5 +1,5 @@
-; RUN: opt -S -tbaa -basicaa -gvn < %s | grep {ret i32 %}
-; RUN: opt -S -tbaa -gvn < %s | grep {ret i32 0}
+; RUN: opt -S -tbaa -basicaa -gvn < %s | FileCheck -check-prefix=BASICAA %s
+; RUN: opt -S -tbaa -gvn < %s | FileCheck %s
; rdar://8875631, rdar://8875069
; BasicAA should notice that the store stores to the entire %u object,
@@ -14,6 +14,8 @@
@endianness_test = global i64 1, align 8
define i32 @signbit(double %x) nounwind {
+; BASICAA: ret i32 %tmp5.lobit
+; CHECK: ret i32 0
entry:
%u = alloca %union.anon, align 8
%tmp9 = getelementptr inbounds %union.anon* %u, i64 0, i32 0
Modified: llvm/trunk/test/Analysis/BasicAA/gcsetest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/gcsetest.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/gcsetest.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/gcsetest.ll Tue Apr 24 04:15:38 2012
@@ -2,12 +2,15 @@
; disambiguating some obvious cases. All loads should be removable in
; this testcase.
-; RUN: opt < %s -basicaa -gvn -instcombine -dce -S \
-; RUN: | not grep load
+; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | FileCheck %s
@A = global i32 7
@B = global i32 8
+; CHECK: define i32 @test()
+; CHECK-NEXT: store i32 123, i32* @B
+; CHECK-NEXT: ret i32 0
+
define i32 @test() {
%A1 = load i32* @A
@@ -18,6 +21,14 @@
ret i32 %X
}
+; CHECK: define i32 @test2()
+; CHECK-NEXT: br label %Loop
+; CHECK: Loop:
+; CHECK-NEXT: store i32 0, i32* @B
+; CHECK-NEXT: br i1 true, label %out, label %Loop
+; CHECK: out:
+; CHECK-NEXT: ret i32 0
+
define i32 @test2() {
%A1 = load i32* @A
br label %Loop
@@ -36,6 +47,10 @@
declare void @external()
+; CHECK: define i32 @test3()
+; CHECK-NEXT: call void @external()
+; CHECK-NEXT: ret i32 7
+
define i32 @test3() {
%X = alloca i32
store i32 7, i32* %X
Modified: llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll Tue Apr 24 04:15:38 2012
@@ -1,9 +1,10 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i1 true}
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; PR2436
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-darwin8"
define i1 @foo(i32 %i) nounwind {
+; CHECK: ret i1 true
entry:
%arr = alloca [10 x i8*] ; <[10 x i8*]*> [#uses=1]
%tmp2 = call i8* @getPtr( ) nounwind ; <i8*> [#uses=2]
Modified: llvm/trunk/test/Analysis/BasicAA/nocapture.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/nocapture.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/nocapture.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/nocapture.ll Tue Apr 24 04:15:38 2012
@@ -1,8 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
declare i32* @test(i32* nocapture)
define i32 @test2() {
+; CHECK: ret i32 0
%P = alloca i32
%Q = call i32* @test(i32* %P)
%a = load i32* %P
Modified: llvm/trunk/test/Analysis/BasicAA/phi-aa.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/phi-aa.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/phi-aa.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/phi-aa.ll Tue Apr 24 04:15:38 2012
@@ -1,10 +1,12 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {NoAlias:.*%P,.*@Z}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
; rdar://7282591
@X = common global i32 0
@Y = common global i32 0
@Z = common global i32 0
+; CHECK: NoAlias: i32* %P, i32* @Z
+
define void @foo(i32 %cond) nounwind {
entry:
%"alloca point" = bitcast i32 0 to i32
Modified: llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll Tue Apr 24 04:15:38 2012
@@ -1,8 +1,17 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \
-; RUN: |& grep {NoAlias: double\\* \[%\]a, double\\* \[%\]b\$} | count 4
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s
; BasicAA should detect NoAliases in PHIs and Selects.
+; CHECK: Function: foo
+; CHECK: NoAlias: double* %a, double* %b
+; CHECK: Function: bar
+; CHECK: NoAlias: double* %a, double* %b
+; CHECK: Function: qux
+; CHECK: NoAlias: double* %a, double* %b
+; CHECK: Function: fin
+; CHECK: NoAlias: double* %a, double* %b
+; CHECK: ===== Alias Analysis Evaluator Report =====
+
; Two PHIs in the same block.
define void @foo(i1 %m, double* noalias %x, double* noalias %y) {
entry:
Modified: llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll Tue Apr 24 04:15:38 2012
@@ -1,7 +1,25 @@
-; RUN: opt < %s -basicaa -gvn -S | grep TestConst | count 2
-; RUN: opt < %s -basicaa -gvn -S | grep TestPure | count 3
-; RUN: opt < %s -basicaa -gvn -S | grep TestNone | count 4
- at g = global i32 0 ; <i32*> [#uses=1]
+; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
+
+ at g = global i32 0
+
+; CHECK: @test
+; CHECK: entry
+; CHECK: %tmp0 = call i32 @TestConst(i32 5) readnone
+; CHECK-NEXT: %tmp1 = call i32 @TestPure(i32 6) readonly
+; CHECK-NEXT: %tmp2 = call i32 @TestNone(i32 7)
+; CHECK-NEXT: store i32 1, i32* @g
+; CHECK-NEXT: %tmp5 = call i32 @TestPure(i32 6) readonly
+; CHECK-NEXT: %tmp7 = call i32 @TestNone(i32 7)
+; CHECK-NEXT: %tmp8 = call i32 @TestNone(i32 7)
+; CHECK-NEXT: %sum0 = add i32 %tmp0, %tmp1
+; CHECK-NEXT: %sum1 = add i32 %sum0, %tmp2
+; CHECK-NEXT: %sum2 = add i32 %sum1, %tmp0
+; CHECK-NEXT: %sum3 = add i32 %sum2, %tmp0
+; CHECK-NEXT: %sum4 = add i32 %sum3, %tmp5
+; CHECK-NEXT: %sum5 = add i32 %sum4, %tmp5
+; CHECK-NEXT: %sum6 = add i32 %sum5, %tmp7
+; CHECK-NEXT: %sum7 = add i32 %sum6, %tmp8
+; CHECK-NEXT: ret i32 %sum7
define i32 @test() {
entry:
Modified: llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll?rev=155432&r1=155431&r2=155432&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll Tue Apr 24 04:15:38 2012
@@ -1,11 +1,7 @@
-; RUN: opt < %s -basicaa -gvn -instcombine |\
-; RUN: llvm-dis | grep {ret i32 0}
-
-declare void @foo(i32*)
-
-declare void @bar()
+; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
define i32 @test() {
+; CHECK: ret i32 0
%A = alloca i32 ; <i32*> [#uses=3]
call void @foo( i32* %A )
%X = load i32* %A ; <i32> [#uses=1]
@@ -14,3 +10,7 @@
%Z = sub i32 %X, %Y ; <i32> [#uses=1]
ret i32 %Z
}
+
+declare void @foo(i32*)
+
+declare void @bar()
More information about the llvm-commits
mailing list