From 2a49d650a5d208f92b0afbfa1e59a58496abe03d Mon Sep 17 00:00:00 2001 From: Stefanos Baziotis Date: Wed, 26 Feb 2020 20:36:11 -0600 Subject: [PATCH] [docs][LoopTerminology] Add Loop Simplify Form description. Information taken from https://youtu.be/3pRhvQi7Z10?t=481 and comments in LoopSimplify.h. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D74989 --- llvm/docs/LoopTerminology.rst | 17 ++++++++++++++++- llvm/docs/Passes.rst | 5 ++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/llvm/docs/LoopTerminology.rst b/llvm/docs/LoopTerminology.rst index e33a019..61f9629 100644 --- a/llvm/docs/LoopTerminology.rst +++ b/llvm/docs/LoopTerminology.rst @@ -141,10 +141,25 @@ are important for working successfully with this interface. reachability of the loop. +.. _loop-terminology-loop-simplify: + Loop Simplify Form ================== -TBD +The Loop Simplify Form is a canonical form that makes +several analyses and transformations simpler and more effective. +It is ensured by the LoopSimplify +(:ref:`-loop-simplify `) pass and is automatically +added by the pass managers when scheduling a LoopPass. +This pass is implemented in +`LoopInfo.h `_. +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) diff --git a/llvm/docs/Passes.rst b/llvm/docs/Passes.rst index 7a90d18..a13f1e6 100644 --- a/llvm/docs/Passes.rst +++ b/llvm/docs/Passes.rst @@ -803,12 +803,15 @@ loop to increment the value by the appropriate amount. A simple loop rotation transformation. +.. _passes-loop-simplify: + ``-loop-simplify``: Canonicalize natural loops ---------------------------------------------- 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. A summary of it can be found in +:ref:`Loop Terminology, Loop Simplify Form `. 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 number of -- 2.7.4