[PATCH] D23288: [LoopSimplify] Rebuild LCSSA for the inner loop after separating nested loops.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 18:25:51 PDT 2016


chandlerc added a comment.

The only way I can see this needing the recursive side of LCSSA is the following.

Imagine you had https://reviews.llvm.org/L1 nested inside L2 nested inside L3 nested inside L4. And this takes the https://reviews.llvm.org/L1 nested loop and makes it a sibling of L3. Now you have L2 nested inside L3 nested inside L4, and https://reviews.llvm.org/L1 nested inside L4. But my reading a code indicates we don't ever do this transform. But if you see a way we could do something similar, and end up with L in the code pointing at L3 for example, we might miss that L2 suddenly needs an LCSSA phi node in addition to L3 needing one.


================
Comment at: test/Transforms/LoopSimplify/pr28272.ll:114
@@ +113,3 @@
+; thus didn't require an lcssa phi nodes).
+; CHECK-LABEL: @foo4
+define void @foo4() {
----------------
It would be really nice to add CHECKs to ensure the particular loop nest structure (after LoopSimplify) is in fact formed... Is that reasonable to do?


https://reviews.llvm.org/D23288





More information about the llvm-commits mailing list