[PATCH] D21112: [LoopSimplify] Preserve LCSSA when merging exit blocks.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 18:01:28 PDT 2016


chandlerc added a comment.

Minor post-commit coments.

I do think we should just always preserve LCSSA. I can't come up with any good reason for not preserving it, and it gives us one fewer code path to test.


================
Comment at: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp:791-793
@@ +790,5 @@
+    assert(LI && "LI not available.");
+    bool InLCSSA =
+        all_of(*LI, [&](Loop *L) { return L->isRecursivelyLCSSAForm(*DT); });
+    assert(InLCSSA && "Requested to preserve LCSSA, but it's already broken.");
+  }
----------------
Hoist the assert into the loop? As is, when the assert fires, you have to go step through a bunch ef iterations of stuff to find the loop in question.

================
Comment at: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp:803-805
@@ +802,5 @@
+  if (PreserveLCSSA) {
+    bool InLCSSA =
+        all_of(*LI, [&](Loop *L) { return L->isRecursivelyLCSSAForm(*DT); });
+    assert(InLCSSA && "LCSSA is broken after loop-simplify.");
+  }
----------------
Same comment as above.


Repository:
  rL LLVM

http://reviews.llvm.org/D21112





More information about the llvm-commits mailing list