diff options
author | Michael Kruse <llvm@meinersbur.de> | 2016-10-04 17:33:34 +0000 |
---|---|---|
committer | Michael Kruse <llvm@meinersbur.de> | 2016-10-04 17:33:34 +0000 |
commit | ca7cbcca373c8ae451b36a9c033d967dde35dcdf (patch) | |
tree | 6d61ec4113fe1a586926ec77c3463ad9128cd535 | |
parent | 0428e93217a55384f08c754ca8353a55334f3ef8 (diff) | |
download | bcm5719-llvm-ca7cbcca373c8ae451b36a9c033d967dde35dcdf.tar.gz bcm5719-llvm-ca7cbcca373c8ae451b36a9c033d967dde35dcdf.zip |
[ScopInfo] Scalar access do not have indirect base pointers.
ScopArrayInfo used to determine base pointer origins by looking up whether the
base pointer is a load. The "base pointer" for scalar accesses is the
llvm::Value being accessed. This is only a symbolic base pointer, it
represents the alloca variable (.s2a or .phiops) generated for it at code
generation.
This patch disables determining base pointer origin for scalars.
A test case where this caused a crash will be added in the next commit. In that
test SAI tried to get the origin base pointer that was only declared later,
therefore not existing. This is probably only possible for scalars used in
PHINode incoming blocks.
llvm-svn: 283232
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 2 | ||||
-rw-r--r-- | polly/test/ScopInfo/non_affine_region_4.ll | 4 | ||||
-rw-r--r-- | polly/test/ScopInfo/scalar.ll | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 30e248d9834..64f3b472689 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -179,7 +179,7 @@ ScopArrayInfo::ScopArrayInfo(Value *BasePtr, Type *ElementType, isl_ctx *Ctx, updateSizes(Sizes); - if (!BasePtr) { + if (!BasePtr || Kind != MK_Array) { BasePtrOriginSAI = nullptr; return; } diff --git a/polly/test/ScopInfo/non_affine_region_4.ll b/polly/test/ScopInfo/non_affine_region_4.ll index 19fdcfd41be..261cda3a585 100644 --- a/polly/test/ScopInfo/non_affine_region_4.ll +++ b/polly/test/ScopInfo/non_affine_region_4.ll @@ -17,13 +17,13 @@ ; CHECK: Arrays { ; CHECK-NEXT: i32 MemRef_A[*]; // Element size 4 ; CHECK-NEXT: i32 MemRef_y__phi; // Element size 4 -; CHECK-NEXT: i32 MemRef_x; [BasePtrOrigin: MemRef_A] // Element size 4 +; CHECK-NEXT: i32 MemRef_x; // Element size 4 ; CHECK-NEXT: } ; ; CHECK: Arrays (Bounds as pw_affs) { ; CHECK-NEXT: i32 MemRef_A[*]; // Element size 4 ; CHECK-NEXT: i32 MemRef_y__phi; // Element size 4 -; CHECK-NEXT: i32 MemRef_x; [BasePtrOrigin: MemRef_A] // Element size 4 +; CHECK-NEXT: i32 MemRef_x; // Element size 4 ; CHECK-NEXT: } ; ; CHECK: Statements { diff --git a/polly/test/ScopInfo/scalar.ll b/polly/test/ScopInfo/scalar.ll index fccfe498c02..ada644c9ce6 100644 --- a/polly/test/ScopInfo/scalar.ll +++ b/polly/test/ScopInfo/scalar.ll @@ -32,12 +32,12 @@ return: ; CHECK: Arrays { ; CHECK-NEXT: i64 MemRef_a[*]; // Element size 8 -; CHECK-NEXT: i64 MemRef_val; [BasePtrOrigin: MemRef_a] // Element size 8 +; CHECK-NEXT: i64 MemRef_val; // Element size 8 ; CHECK-NEXT: } ; ; CHECK: Arrays (Bounds as pw_affs) { ; CHECK-NEXT: i64 MemRef_a[*]; // Element size 8 -; CHECK-NEXT: i64 MemRef_val; [BasePtrOrigin: MemRef_a] // Element size 8 +; CHECK-NEXT: i64 MemRef_val; // Element size 8 ; CHECK-NEXT: } ; ; CHECK: Statements { |