[PATCH] D74890: [Analysis] getParentLoop() documentation

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 09:09:38 PST 2020


Meinersbur added inline comments.


================
Comment at: llvm/docs/LoopTerminology.rst:120-121
 
+Parent Loop - A loop is either a top level loop, that is it
+is not enclosed in any other loop or it is a sub-loop of another.
+A parent of a loop is the innermost loop in which it is enclosed in.
----------------
baziotis wrote:
> Meinersbur wrote:
> > [grammar] "that is it is"
> > 
> > I also don't understand this part of a definition. Does it clarify in what positions a loop can be (it makes it an unusually structured dictionary definition -- I'd expect the first sentence to explain what a "parent loop" is followed by further explanations)? IMHO the LoopInfo being a [[ https://en.wikipedia.org/wiki/Tree_(graph_theory)#Forest | forest  ]] is enough information.
> Ok, thanks for the comment, indeed the definition structure is kind of bad. Regarding the last note, I think it's not stated in the terminology (although it's stated in some parts of `LoopInfo.h`). Do you think it would be good to add this clarification?
> Or maybe a last point in the introduction: "A loop can have only a single parent loop (in which it is entirely contained)". Something like that. Basically just to make obvious that a loop can have only a single parent.
I'd expect that tree concepts (node, root, leaf, child, parent, sibling, ancestor, descendent, ...) are known by a majority of programmers, but you should go for what you think is needed for someone who does not know terminology already (i.e. not me). I will look for that it's correct and understandable.


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

https://reviews.llvm.org/D74890





More information about the llvm-commits mailing list