[PATCH] D89739: [LCSSA] Doc for special treatment of PHIs

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 10:41:17 PDT 2020


Meinersbur added inline comments.


================
Comment at: llvm/docs/LoopTerminology.rst:175
 in LCSSA. To achieve the latter, single entry PHI nodes are inserted
-at the end of the loops for all values that are live
-across the loop boundary [#lcssa-construction]_.
-In particular, consider the following loop:
+at the end of the loop (specifically at its exit blocks) for all values
+that are live across the loop boundary [#lcssa-construction]_
----------------
> specifically at its exit blocks

This wording is somewhat imprecise (where is 'at'? an exit block is after the loop), Suggestion: "PHI nodes with just a single incoming value/block are added into each of the loop's exit blocks ..."


================
Comment at: llvm/docs/LoopTerminology.rst:223-225
+corresponding predecessor block to the current block". To that end,
+formally the use truly happens at the boundary of the loop and for
+the purposes of LCSSA, we consider it happens inside it.
----------------
The edge is clearly outside the loop, since when the control-flow uses it, it will not be looping anymore.

Treating the exiting block as user moves the use into the loop. For the purpose of LCSSA, this is exactly be what we want, since ensures all values that are defined in a loop are also only used in the loop. Could you move that part to the following paragraph to separate its from the strict formalism?


================
Comment at: llvm/lib/Transforms/Utils/LCSSA.cpp:171
+      // that every incoming block/edge is dominated by `I` as well,
+      // i.e. we can add uses of `I` to those incoming edges/append to the the incoming
+      // blocks without violating the SSA dominance property.
----------------
[grammar] "the the"


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

https://reviews.llvm.org/D89739



More information about the llvm-commits mailing list