[PATCH] D16382: Add LoopSimplifyCFG pass

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 15:45:47 PST 2016


sanjoy added inline comments.

================
Comment at: lib/Transforms/Scalar/LoopSimplifyCFG.cpp:109
@@ +108,3 @@
+    LI->removeBlock(Pred);
+    MergeBasicBlockIntoOnlyPred(Succ, DT);
+    changed = true;
----------------
escha wrote:
> sanjoy wrote:
> > This is going to `free` `Pred`, right?  Is it possible that `Pred` is after `Succ` in `Blocks` and you'll end up trying to examine a `free`'ed block later?
> Ugh, I guess this is possible. How do we avoid this given iterator invalidation issues?
I think things would Just Work(TM) if you have `SmallVector<WeakVH, 16> Blocks`, and check if an entry has been null'ed out before you do anything with it.


Repository:
  rL LLVM

http://reviews.llvm.org/D16382





More information about the llvm-commits mailing list