[PATCH] D79037: [StructurizeCFG] Fix region nodes ordering
Ehud Katz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 3 08:29:42 PDT 2020
ekatz marked an inline comment as done.
ekatz added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/StructurizeCFG.cpp:393
+ // Keep processing loops while only going deeper (into inner loops).
+ do {
+ assert(I != POT.rend());
----------------
sameerds wrote:
> ekatz wrote:
> > sameerds wrote:
> > > Why not just have `while (CurrentLoopSize)` here? At least from what I could see, the value should be non-zero when this point is reached from above, right?
> > The problem is that `CurrentLoopSize` may be null in case all of the nodes have a parent loop (none outside from every loop).
> > In that case, `CurrentLoopSize` will only be valid from line 408; and remain that way all the way until the end.
> I am not sure I follow. Can you please rephrase? An example might be useful.
The simplest example is a region without loops. Then the `CurrentLoop` (and in turn, `CurrentLoopSize`) is `nullptr`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79037/new/
https://reviews.llvm.org/D79037
More information about the llvm-commits
mailing list