MemoryAccess *MA;
/// The context under which the access is not invariant.
- isl_set *NonHoistableCtx;
+ isl::set NonHoistableCtx;
};
/// Ordered container type to hold invariant accesses.
auto *AccInst = InvMAs.front().MA->getAccessInstruction();
invalidate(COMPLEXITY, AccInst->getDebugLoc(), AccInst->getParent());
isl_set_free(DomainCtx);
- for (auto &InvMA : InvMAs)
- isl_set_free(InvMA.NonHoistableCtx);
return;
}
for (auto &InvMA : InvMAs) {
auto *MA = InvMA.MA;
- auto *NHCtx = InvMA.NonHoistableCtx;
+ auto *NHCtx = InvMA.NonHoistableCtx.copy();
// Check for another invariant access that accesses the same location as
// MA and if found consolidate them. Otherwise create a new equivalence
for (MemoryAccess *Access : Stmt)
if (isl::set NHCtx = getNonHoistableCtx(Access, Writes))
- InvariantAccesses.push_back({Access, NHCtx.release()});
+ InvariantAccesses.push_back({Access, NHCtx});
// Transfer the memory access from the statement to the SCoP.
for (auto InvMA : InvariantAccesses)