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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 13:06:57 PST 2019


fhahn added inline comments.


================
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.
----------------
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.





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

https://reviews.llvm.org/D56848





More information about the llvm-commits mailing list