[ScopInfo] Move InvariantAccess to isl++ [NFC]
authorTobias Grosser <tobias@grosser.es>
Sun, 6 Aug 2017 17:25:14 +0000 (17:25 +0000)
committerTobias Grosser <tobias@grosser.es>
Sun, 6 Aug 2017 17:25:14 +0000 (17:25 +0000)
llvm-svn: 310213

polly/include/polly/ScopInfo.h
polly/lib/Analysis/ScopInfo.cpp

index edbce0b..1c3619a 100644 (file)
@@ -1122,7 +1122,7 @@ struct InvariantAccess {
   MemoryAccess *MA;
 
   /// The context under which the access is not invariant.
-  isl_set *NonHoistableCtx;
+  isl::set NonHoistableCtx;
 };
 
 /// Ordered container type to hold invariant accesses.
index 11f9d5b..d62262e 100644 (file)
@@ -3886,8 +3886,6 @@ void Scop::addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs) {
     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;
   }
 
@@ -3919,7 +3917,7 @@ void Scop::addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs) {
 
   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
@@ -4116,7 +4114,7 @@ void Scop::hoistInvariantLoads() {
 
     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)