mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 17:07:36 +08:00
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. llvm-svn: 275053
This commit is contained in:
@@ -869,7 +869,9 @@ void MemoryAccess::dump() const { print(errs()); }
|
||||
__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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user