[PATCH] D64224: Keep the order of the basic blocks in the cloned loop as the original loop

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 18:36:54 PDT 2019


hfinkel added a comment.

Do you have any kind of test case?  I suppose that you can check the output in a test in test/Analysis/LoopInfo to show the ordering?



================
Comment at: llvm/lib/Transforms/Utils/CloneFunction.cpp:783
+  for (BasicBlock *BB : OrigLoop->getBlocks()) {
+    Loop *CurLoop = LI->getLoopFor(BB);
+    Loop *&NewLoop = LMap[CurLoop];
----------------
Is this logic equivalent? The original code is going a pre-order traversal, and for each loop, it excludes blocks in an inner loop (when `CurLoop != LI->getLoopFor(BB)`). Here we're doing something for all blocks in the loop including those also in inner loops?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64224/new/

https://reviews.llvm.org/D64224





More information about the llvm-commits mailing list