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
// TODO: We can provide more information for better but more expensive
// results.
if (!isDereferenceableAndAlignedPointer(LInst->getPointerOperand(),
+ LInst->getType(),
LInst->getAlignment(), DL))
return false;
for (auto NonAffineRegion : Context.NonAffineSubRegionSet) {
if (isSafeToLoadUnconditionally(Load->getPointerOperand(),
- Load->getAlignment(), DL))
+ Load->getType(), Load->getAlignment(),
+ DL))
continue;
if (NonAffineRegion->contains(Load) &&