summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/lib/Analysis/ScopBuilder.cpp5
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index 6b75a820d7a..8ae29e223a7 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -1435,8 +1435,8 @@ isl::set ScopBuilder::getNonHoistableCtx(MemoryAccess *Access,
isl::set SafeToLoad;
auto &DL = scop->getFunction().getParent()->getDataLayout();
- if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getAlignment(),
- DL)) {
+ if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getType(),
+ LI->getAlignment(), DL)) {
SafeToLoad = isl::set::universe(AccessRelation.get_space().range());
} else if (BB != LI->getParent()) {
// Skip accesses in non-affine subregions as they might not be executed
@@ -1487,6 +1487,7 @@ bool ScopBuilder::canAlwaysBeHoisted(MemoryAccess *MA,
// TODO: We can provide more information for better but more expensive
// results.
if (!isDereferenceableAndAlignedPointer(LInst->getPointerOperand(),
+ LInst->getType(),
LInst->getAlignment(), DL))
return false;
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index ebe70ef6912..da4b9bb1797 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -468,7 +468,8 @@ bool ScopDetection::onlyValidRequiredInvariantLoads(
for (auto NonAffineRegion : Context.NonAffineSubRegionSet) {
if (isSafeToLoadUnconditionally(Load->getPointerOperand(),
- Load->getAlignment(), DL))
+ Load->getType(), Load->getAlignment(),
+ DL))
continue;
if (NonAffineRegion->contains(Load) &&
OpenPOWER on IntegriCloud