[PATCH] D12758: Allow general loops with one latch

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 09:47:29 PDT 2015


Meinersbur accepted this revision.

================
Comment at: include/polly/ScopInfo.h:654
@@ -655,3 +653,3 @@
 
-  std::vector<Loop *> NestLoops;
+  SmallVector<Loop *, 4> NestLoops;
 
----------------
This change looks unrelated

================
Comment at: lib/Analysis/ScopInfo.cpp:981
@@ +980,3 @@
+    isl_id *DimId = isl_set_get_dim_id(Domain, isl_dim_set, u);
+    NestLoops.push_back(static_cast<Loop *>(isl_id_get_user(DimId)));
+    isl_id_free(DimId);
----------------
Can we have an assert here to ensure that the id has been set before?

================
Comment at: lib/Analysis/ScopInfo.cpp:1494
@@ -1473,1 +1493,3 @@
 
+static inline __isl_give isl_set *addDomainDimId(__isl_take isl_set *Domain,
+                                                 unsigned Dim, Loop *L) {
----------------
Rename to setDomainDimId?
"add" made me think it would append another dimension.

================
Comment at: lib/Analysis/ScopInfo.cpp:1515
@@ +1514,3 @@
+  Loop *L = LI.getLoopFor(EntryBB);
+  while (LD-- >= 0) {
+    S = addDomainDimId(S, LD + 1, L);
----------------
for (int LD = getRelativeLoopDepth(LI.getLoopFor(EntryBB)); LD >= 0; LD-=1)

================
Comment at: lib/Analysis/ScopInfo.cpp:2137
@@ +2136,3 @@
+  Loop *L = getLoopSurroundingRegion(R, LI);
+  LoopSchedules[L];
+  buildSchedule(&R, TempScop, LI, SD, LoopSchedules);
----------------
This may make sense to create an element, but looks wrong.

================
Comment at: lib/Analysis/ScopInfo.cpp:2139
@@ -2042,1 +2138,3 @@
+  buildSchedule(&R, TempScop, LI, SD, LoopSchedules);
+  Schedule = LoopSchedules[L].first;
 
----------------
    Schedule = LoopSchedules.count(L) ? LoopSchedules[L].first : nullptr;
as alternative to line 2137


================
Comment at: lib/Analysis/ScopInfo.cpp:2547
@@ +2546,3 @@
+    while (L && NumVisited == L->getNumBlocks()) {
+      auto *LDomain = isl_schedule_get_domain(LSchedulePair.first);
+      if (auto *MUPA = mapToDimension(LDomain, LD + 1))
----------------
isl_set *LDomain

================
Comment at: lib/Analysis/ScopInfo.cpp:2552
@@ +2551,3 @@
+
+      auto *PL = L->getParentLoop();
+      assert(LoopSchedules.count(PL));
----------------
Loop *PL

================
Comment at: lib/Support/ScopHelper.cpp:36
@@ -35,3 @@
-// Cast the region to loop if there is a loop have the same header and exit.
-Loop *polly::castToLoop(const Region &R, LoopInfo &LI) {
-  BasicBlock *entry = R.getEntry();
----------------
Really good this finally does away


http://reviews.llvm.org/D12758





More information about the llvm-commits mailing list