[PATCH] D56848: [LCSSA] Skip blocks in sub-loops when scanning for uses.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 17:13:50 PST 2019


davide accepted this revision.
davide added a comment.

LGTM, just a minor comment (food for thought).



================
Comment at: llvm/lib/Transforms/Utils/LCSSA.cpp:328
   for (BasicBlock *BB : BlocksDominatingExits) {
+    // Skip blocks that are part of any sub-loops, as we already scanned them
+    // previously.
----------------
fhahn wrote:
> efriedma wrote:
> > The relevant property here is that the sub-loops are already in LCSSA form, right?  The documentation for formLCSSA doesn't actually say that explicitly... granted, it's probably true in the cases we care about.
> That's a better way of putting it, yes! The formLCSSA uses in LCSSA.cpp guarantee that already and I checked the other 3 uses in LoopSimplify.cpp and SimpleLoopUnswitch.cpp and they either call formLCSSA depth first for their sub-loops or assert that the subloops are in LCSSA form.
> 
> 
> 
This property of sub loops should always be true, maybe there's a way of verifying this?


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

https://reviews.llvm.org/D56848





More information about the llvm-commits mailing list