Skip to content

Commit 2a49d65

Browse files
baziotisMeinersbur
authored andcommitted
[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
1 parent 21056a4 commit 2a49d65

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

llvm/docs/LoopTerminology.rst

+16-1
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,25 @@ are important for working successfully with this interface.
141141
reachability of the loop.
142142

143143

144+
.. _loop-terminology-loop-simplify:
145+
144146
Loop Simplify Form
145147
==================
146148

147-
TBD
149+
The Loop Simplify Form is a canonical form that makes
150+
several analyses and transformations simpler and more effective.
151+
It is ensured by the LoopSimplify
152+
(:ref:`-loop-simplify <passes-loop-simplify>`) pass and is automatically
153+
added by the pass managers when scheduling a LoopPass.
154+
This pass is implemented in
155+
`LoopInfo.h <http://llvm.org/doxygen/LoopSimplify_8h_source.html>`_.
156+
When it is successful, the loop has:
157+
158+
* A preheader.
159+
* A single backedge (which implies that there is a single latch).
160+
* Dedicated exits. That is, no exit block for the loop
161+
has a predecessor that is outside the loop. This implies
162+
that all exit blocks are dominated by the loop header.
148163

149164

150165
Loop Closed SSA (LCSSA)

llvm/docs/Passes.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,15 @@ loop to increment the value by the appropriate amount.
803803

804804
A simple loop rotation transformation.
805805

806+
.. _passes-loop-simplify:
807+
806808
``-loop-simplify``: Canonicalize natural loops
807809
----------------------------------------------
808810

809811
This pass performs several transformations to transform natural loops into a
810812
simpler form, which makes subsequent analyses and transformations simpler and
811-
more effective.
813+
more effective. A summary of it can be found in
814+
:ref:`Loop Terminology, Loop Simplify Form <loop-terminology-loop-simplify>`.
812815

813816
Loop pre-header insertion guarantees that there is a single, non-critical entry
814817
edge from outside of the loop to the loop header. This simplifies a number of

0 commit comments

Comments
 (0)