[polly] r275053 - load hoisting: compute memory access invalid context only for domain

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 05:01:28 PDT 2016


Author: grosser
Date: Mon Jul 11 07:01:26 2016
New Revision: 275053

URL: http://llvm.org/viewvc/llvm-project?rev=275053&view=rev
Log:
load hoisting: compute memory access invalid context only for domain

We now compute the invalid context of memory accesses only for the domain under
which the memory access is executed. Without limiting ourselves to this
restricted domain, invalid accesses outside of the domain of actually executed
statement instances may result in the execution domain of the statement to
become empty despite the fact that the statement will actually be executed. As a
result, such scops would use unitialized values for their computations which
results in incorrect computations.

This fixes http://llvm.org/PR27944 and unbreaks the
-polly-position=before-vectorizer buildbots.

Modified:
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=275053&r1=275052&r2=275053&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Jul 11 07:01:26 2016
@@ -869,7 +869,9 @@ void MemoryAccess::dump() const { print(
 __isl_give isl_pw_aff *MemoryAccess::getPwAff(const SCEV *E) {
   auto *Stmt = getStatement();
   PWACtx PWAC = Stmt->getParent()->getPwAff(E, Stmt->getEntryBlock());
-  InvalidDomain = isl_set_union(InvalidDomain, PWAC.second);
+  isl_set *StmtDom = isl_set_reset_tuple_id(getStatement()->getDomain());
+  isl_set *NewInvalidDom = isl_set_intersect(StmtDom, PWAC.second);
+  InvalidDomain = isl_set_union(InvalidDomain, NewInvalidDom);
   return PWAC.first;
 }
 




More information about the llvm-commits mailing list