[PATCH] D23148: [LoopUnroll] Simplify loops created by unrolling.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 19:37:03 PDT 2016


chandlerc added inline comments.

================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:386-387
@@ +385,4 @@
+  SmallSetVector<Loop *, 4> LoopsToSimplify;
+  for (Loop *SubLoop : *L)
+    LoopsToSimplify.insert(SubLoop);
+
----------------
So, this is done because we leave the first copy of the loop alone when unrolling?

If not, shouldn't we handle this below so that we don't add inner loops that won't actually exist after unrolling?

================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:692
@@ +691,3 @@
+    } else {
+      // Simplify loops for which we might've broken loop-simplify form.
+      for (Loop *SubLoop : LoopsToSimplify)
----------------
Related to the above TODO comment, the ways in which this can break loop simplified form seem fairly constrained. If this is a compile time issue, its likely a more targeted approach could be used... Happy to just leave a comment here if you don't yet know whether we need to consider the compile time here.


https://reviews.llvm.org/D23148





More information about the llvm-commits mailing list