[BasicAA] Add datalayouts to make some tests more useful. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 5 Feb 2015 21:10:14 +0000 (21:10 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 5 Feb 2015 21:10:14 +0000 (21:10 +0000)
Fixes PR22462: two of the tests have regressed for a while,
but were using CHECK-NOT to match "May:".  The actual output
was changed to "MayAlias:" at some point, which made the tests
useless.
Two others return MayAlias only because of a lack of analysis;
BasicAA returns PartialAlias in those cases, when a datalayout
is present.

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

test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll
test/Analysis/BasicAA/constant-over-index.ll

index 768411e9d35f872411faf60d6eb91128a83551ea..f2b06cb81436578b646c1e241eb45a527cf6de77 100644 (file)
@@ -3,10 +3,12 @@
 
 ; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
 
 
 ; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
 
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
 %T = type { i32, [10 x i8] }
 
 ; CHECK:     Function: test
 %T = type { i32, [10 x i8] }
 
 ; CHECK:     Function: test
-; CHECK-NOT:   May:
+; CHECK-NOT:   MayAlias:
 
 define void @test(%T* %P) {
   %A = getelementptr %T* %P, i64 0
 
 define void @test(%T* %P) {
   %A = getelementptr %T* %P, i64 0
index b7bbf7732f95c416d3f0d0649c9e3e41136e6f35..42512b8f6bf285fb4c416f5843319715cb3756d2 100644 (file)
@@ -3,12 +3,14 @@
 
 ; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
 
 
 ; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
 
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
 %T = type { i32, [10 x i8] }
 
 @G = external global %T
 
 ; CHECK:     Function: test
 %T = type { i32, [10 x i8] }
 
 @G = external global %T
 
 ; CHECK:     Function: test
-; CHECK-NOT:   May:
+; CHECK-NOT:   MayAlias:
 
 define void @test() {
   %D = getelementptr %T* @G, i64 0, i32 0
 
 define void @test() {
   %D = getelementptr %T* @G, i64 0, i32 0
index 4be793ec416afabcbff03261409dfdf9bbc9274b..d11e75dfb7d33c37fd619f4b458309574d3468e1 100644 (file)
@@ -1,9 +1,11 @@
 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
 
 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
 
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
 ; CHECK: Function: foo
 ; CHECK: Function: foo
-; CHECK:   MayAlias: i32* %Ipointer, i32* %Jpointer
+; CHECK:   PartialAlias: i32* %Ipointer, i32* %Jpointer
 ; CHECK: 9 no alias responses
 ; CHECK: 9 no alias responses
-; CHECK: 6 may alias responses
+; CHECK: 6 partial alias responses
 
 define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
   %Ipointer = getelementptr i32* %p, i32 %i
 
 define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
   %Ipointer = getelementptr i32* %p, i32 %i
index 232533cc73e11ec74f6f2bd5e3e9c4dbab7e9ffe..aeb068b24aa5aec2fcb249cd4fdaed44fdfeb48c 100644 (file)
@@ -1,10 +1,13 @@
 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
 ; PR4267
 
 ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
 ; PR4267
 
-; CHECK: MayAlias: double* %p.0.i.0, double* %p3
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+; CHECK: PartialAlias: double* %p.0.i.0, double* %p3
 
 ; %p3 is equal to %p.0.i.0 on the second iteration of the loop,
 
 ; %p3 is equal to %p.0.i.0 on the second iteration of the loop,
-; so MayAlias is needed.
+; so MayAlias is needed.  In practice, basicaa returns PartialAlias
+; for GEPs to ignore TBAA.
 
 define void @foo([3 x [3 x double]]* noalias %p) {
 entry:
 
 define void @foo([3 x [3 x double]]* noalias %p) {
 entry: