[PATCH] D54023: [LoopSimplifyCFG] Delete dead in-loop blocks

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 22 04:47:14 PST 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopSimplifyCFG.cpp:228
            "Header not in loop?");
   }
 
----------------
mkazantsev wrote:
> fedor.sergeev wrote:
> >  Dont you want to add an assert here on
> >   BlocksInLoopAfterFolding + DeadLoopBlocks <= NumBlocks ?
> > you seem to be relying on that invariant later on (when comparing this sum with numblocks for equality).
> Well, by construction `BlocksInLoopAfterFolding` is a subset of `LiveLoopBlocks` (see `IsEdgeLive`), and we have this:
> 
>     assert(L.getNumBlocks() == LiveLoopBlocks.size() + DeadLoopBlocks.size() &&
>            "Malformed block sets?");
> 
> Do you really think that what you propose is needed?
> 
I've commited rL347458, along with the assert in my comment above they ensure what you need.


https://reviews.llvm.org/D54023





More information about the llvm-commits mailing list