[PATCH] D21665: [LoopSimplify] Update LCSSA after separating nested loops.

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 12:56:54 PDT 2016


mzolotukhin added a comment.

Thanks for reviewing, Sanjoy!

I committed this in r275891 with your remarks addressed.

Michael


================
Comment at: lib/Transforms/Utils/LoopSimplify.cpp:331
@@ -329,1 +330,3 @@
+  SmallSetVector<BasicBlock *, 8> OuterLoopBlocks;
+  OuterLoopBlocks.insert(NewBB);
   // Now that we know which blocks are in L and which need to be moved to
----------------
sanjoy wrote:
> Can't this just be a `SmallVector` ?
Indeed it can. Fixed!

================
Comment at: lib/Transforms/Utils/LoopSimplify.cpp:384
@@ +383,3 @@
+            continue;
+          formLCSSAForInstruction(*L, *OpI, *DT, ExitBlocks, PredCache, LI);
+        }
----------------
sanjoy wrote:
> How about avoiding repeated calls to `formLCSSAForInstruction` on the same instruction using a set?
> 
> Given that you'll now send in a worklist of instructions anyway, maybe just unique that worklist before sending it in?
Fixed.

================
Comment at: lib/Transforms/Utils/LoopSimplify.cpp:594
@@ +593,3 @@
+    if (any_of(predecessors(ExitBlock),
+               [L](BasicBlock *BB) { return !L->contains(BB); })) {
+      rewriteLoopExitBlock(L, ExitBlock, DT, LI, PreserveLCSSA);
----------------
sanjoy wrote:
> I was asking to use `any_of` instead of the loop you added. :)
> 
> If you want to clean this up also, that's fine too of course. :)
Oops, wrong spot:)


Repository:
  rL LLVM

https://reviews.llvm.org/D21665





More information about the llvm-commits mailing list