[PATCH] D65164: Define some basic terminology around loops in our documentation
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 20:49:05 PDT 2019
jdoerfert added a comment.
Some comments, clarifications, and proposed additions.
Thanks for doing this!
================
Comment at: docs/LoopTerminology.rst:23
+ dominance requirement and such are not considered loops. LoopInfo
+ does not include such cycles.
+
----------------
Could we add something like:
> commonly referred to as irreducible control flow, or irreducible loops.
================
Comment at: docs/LoopTerminology.rst:35
+ outside the loop. A loop is allowed to be statically infinite, so
+ there need not be any exiting edges.
+
----------------
> * The loop header identifies a loop.
> * Two loops are either disjoint or one is properly contained in the other.
> * LoopInfo organizes loops in a tree structure with an artificial top-level loop in each function that contains all loops not contained in other loops.
================
Comment at: docs/LoopTerminology.rst:48
+contained within the loop. As such, it is the first one executed if
+the loop executes at all.
+
----------------
"The basic block", not "a".
================
Comment at: docs/LoopTerminology.rst:63
+may have multiple latch blocks. A latch block may be conditional or
+unconditional.
+
----------------
Let's make "the source of a backedge" a sentence:
> Thus, q latch block is the source of a backedge.
================
Comment at: docs/LoopTerminology.rst:81
+qualification of the event as a shorthand for when some exiting block
+branches to some exit block. May be zero, or not statically computable.
+
----------------
Why "interesting event happens"?
> The backedge*s* are traversed *without leaving the loop*
================
Comment at: docs/LoopTerminology.rst:89
+width integers (such as LLVM Values or SCEVs), you need to be cautious
+of overflow when converting one to the other.)
+
----------------
Again, we should mention "executed before the loop is left".
================
Comment at: docs/LoopTerminology.rst:90
+of overflow when converting one to the other.)
+
+Loop Simplify Form
----------------
> A basic block can be a exiting block and a latch block at the same time.
> A basic block can also be loop predecessor and a exit block at the same time.
> Irreducible Control Flow - Also known as irreducible loops, are non-loop cycle in the CFG. They differ from the LLVM definition of loops because they do not have a header block, thus no block in the cycle dominates all blocks in the cycle. Warning: LoopInfo does not identify irreducible control flow which means that even in a non-recursive function without loops blocks can be executed multiple times.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65164/new/
https://reviews.llvm.org/D65164
More information about the llvm-commits
mailing list