@@ -62,9 +62,40 @@ struct VPlanTransforms {
6262 // / The created loop is wrapped in an initial skeleton to facilitate
6363 // / vectorization, consisting of a vector pre-header, an exit block for the
6464 // / main vector loop (middle.block) and a new block as preheader of the scalar
65- // / loop (scalar.ph). It also adds a canonical IV and its increment, using \p
66- // / InductionTy and \p IVDL, and creates a VPValue expression for the original
67- // / trip count.
65+ // / loop (scalar.ph). See below for an illustration. It also adds a canonical
66+ // / IV and its increment, using \p InductionTy and \p IVDL, and creates a
67+ // / VPValue expression for the original trip count.
68+ // /
69+ // / [ ] <-- Plan's entry VPIRBasicBlock, wrapping the original loop's
70+ // / / \ old preheader. Will contain iteration number check and SCEV
71+ // / | | expansions.
72+ // / | |
73+ // / / v
74+ // / | [ ] <-- vector loop bypass (may consist of multiple blocks) will be
75+ // / | / | added later.
76+ // / | / v
77+ // / || [ ] <-- vector pre header.
78+ // / |/ |
79+ // / | v
80+ // / | [ ] \ <-- plain CFG loop wrapping original loop to be vectorized.
81+ // / | [ ]_|
82+ // / | |
83+ // / | v
84+ // / | [ ] <--- middle-block with the branch to successors
85+ // / | / |
86+ // / | / |
87+ // / | | v
88+ // / \--->[ ] <--- scalar preheader (initial a VPBasicBlock, which will be
89+ // / | | replaced later by a VPIRBasicBlock wrapping the scalar
90+ // / | | preheader basic block.
91+ // / | |
92+ // / v <-- edge from middle to exit iff epilogue is not required.
93+ // / | [ ] \
94+ /// | [ ]_| <-- old scalar loop to handle remainder (scalar epilogue,
95+ // / | | header wrapped in VPIRBasicBlock).
96+ // / \ |
97+ // / \ v
98+ // / >[ ] <-- original loop exit block(s), wrapped in VPIRBasicBlocks.
6899 LLVM_ABI_FOR_TEST static std::unique_ptr<VPlan>
69100 buildVPlan0 (Loop *TheLoop, LoopInfo &LI, Type *InductionTy, DebugLoc IVDL,
70101 PredicatedScalarEvolution &PSE);
0 commit comments