[PATCH] D88408: [docs] Revise loop terminology reference.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 12:44:06 PDT 2020


Meinersbur added a comment.

What do you think of the revision? Does it clarify things? Is it more understandable?



================
Comment at: llvm/docs/LoopTerminology.rst:93
+
+* A cycle in the CFG does not imply there is a loop. The example below shows such a CFG, where there is no header node that dominates all other nodes in the cycle. This is called **irreducible control-flow**.  
+
----------------
baziotis wrote:
> Do you think that adding some info on where the term irreducible comes from would be beneficial?
> 
> Something like:
> Irreducible control-flow is the opposite of reducible control-flow.
> The term reducible results from several kinds of transformations that
> can be applied to (control-)flow (sub-)graphs that collapse sub-graphs into single nodes and, hence,
> "reduce" the CFG successively to simpler graphs, with a CFG considered
> to be reducible if applying a sequence of such transformations ultimately reduces
> it to a single node. 
> 
> And maybe a reference if the reader is interested to learn more.
I think I condensed you wording while still saying more. Please check whether it is still understandable.


================
Comment at: llvm/docs/LoopTerminology.rst:104
+
+* A branch inside a loop that does not lead back to the loop is ot considered part of the loop, as illustrated below
+
----------------
baziotis wrote:
> [nit] "ot" -> "not"
> 
> I think this example is a little bit confusing. First of all, a branch is an instruction and a loop contains basic blocks. You may mean / like this: Any BB that contains a branch that *never* (in bold to show the difference with exiting blocks, maybe even mention it in parens) leads back to the loop (or, all its successors are outside of the loop), is not considered part of the loop.
Just "never" could also be "dynamically never" and still be part of the loop.


================
Comment at: llvm/docs/LoopTerminology.rst:144
+
+ * The number of executions of the loop header before leaving the loop is the **loop trip count**. If the loop should not be executed at all, a **loop guard** must skip the entire loop:
+
----------------
baziotis wrote:
> I think that the reference to the loop guard here is out of the blue it raises questions. It may be better to just leave the loop rotate part reference it.
> 
> Also, we might want to add "loop trip count (also called iteration count)".
The existence of a loop guard is independent of the loop-rotated normal form, the same way a preheader may exist before LoopSimplify.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88408



More information about the llvm-commits mailing list