Index: llvm/docs/LoopTerminology.rst =================================================================== --- llvm/docs/LoopTerminology.rst +++ llvm/docs/LoopTerminology.rst @@ -144,7 +144,19 @@ Loop Simplify Form ================== -TBD +The Loop Simplify Form is a canonical form that makes +several analyses and transformations simpler and more effective. +This loop is ensured by the LoopSimplify (`-loop-simplify`) pass +and is automatically added by the pass managers when scheduling +a LoopPass. This pass is implemented in +`LoopInfo.h http://llvm.org/doxygen/LoopSimplify_8h_source.html`_. +When it is successful, the loop has: + +* A preheader. +* A single backedge (which implies that there is a single latch). +* Dedicated exits. That is, no exit block for the loop + has a predecessor that is outside the loop. This implies + that all exit blocks are dominated by the loop header. Loop Closed SSA (LCSSA) Index: llvm/include/llvm/Transforms/Utils/LoopSimplify.h =================================================================== --- llvm/include/llvm/Transforms/Utils/LoopSimplify.h +++ llvm/include/llvm/Transforms/Utils/LoopSimplify.h @@ -8,7 +8,7 @@ // // This pass performs several transformations to transform natural loops into a // simpler form, which makes subsequent analyses and transformations simpler and -// more effective. +// more effective. It is added by the pass managers when scheduling a LoopPass. // // Loop pre-header insertion guarantees that there is a single, non-critical // entry edge from outside of the loop to the loop header. This simplifies a @@ -20,7 +20,8 @@ // by the loop header). This simplifies transformations such as store-sinking // that are built into LICM. // -// This pass also guarantees that loops will have exactly one backedge. +// This pass also guarantees that loops will have exactly one backedge +// (which implies that there is a single latch). // // Indirectbr instructions introduce several complications. If the loop // contains or is entered by an indirectbr instruction, it may not be possible