[polly] r283232 - [ScopInfo] Scalar access do not have indirect base pointers.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 10:33:35 PDT 2016


Author: meinersbur
Date: Tue Oct  4 12:33:34 2016
New Revision: 283232

URL: http://llvm.org/viewvc/llvm-project?rev=283232&view=rev
Log:
[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.

Modified:
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/test/ScopInfo/non_affine_region_4.ll
    polly/trunk/test/ScopInfo/scalar.ll

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=283232&r1=283231&r2=283232&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Oct  4 12:33:34 2016
@@ -179,7 +179,7 @@ ScopArrayInfo::ScopArrayInfo(Value *Base
 
   updateSizes(Sizes);
 
-  if (!BasePtr) {
+  if (!BasePtr || Kind != MK_Array) {
     BasePtrOriginSAI = nullptr;
     return;
   }

Modified: polly/trunk/test/ScopInfo/non_affine_region_4.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/non_affine_region_4.ll?rev=283232&r1=283231&r2=283232&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/non_affine_region_4.ll (original)
+++ polly/trunk/test/ScopInfo/non_affine_region_4.ll Tue Oct  4 12:33:34 2016
@@ -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 {

Modified: polly/trunk/test/ScopInfo/scalar.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/scalar.ll?rev=283232&r1=283231&r2=283232&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/scalar.ll (original)
+++ polly/trunk/test/ScopInfo/scalar.ll Tue Oct  4 12:33:34 2016
@@ -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 {




More information about the llvm-commits mailing list