This patch extends the scope of VPlan to also model the pre-header.
The pre-header can be used to place recipes that should be code-gen'd
outside the loop, like SCEV expansion.
Depends on D121623.
Paths
| Differential D121624
[VPlan] Model pre-header explicitly. ClosedPublic Authored by fhahn on Mar 14 2022, 10:18 AM.
Details
Summary This patch extends the scope of VPlan to also model the pre-header. Depends on D121623.
Diff Detail
Event TimelineComment Actions Fix VPlan-native path. Prevously, VPlan-native VPlans had an empty pre-header as part of the main vector loop region. That has been fixed now and all code dealing with native VPlans has been updated. This removes a few places where we had to distinguish between inner loop and VPlan-native plans until now. All tests are now updated as well and the patch is ready for review. fhahn retitled this revision from [VPlan] Model pre-header explicitly (WIP). to [VPlan] Model pre-header explicitly..Mar 16 2022, 6:11 AM fhahn added a child revision: D122095: [VPlan] Place VPExpandSCEVRecipe in pre-header..Mar 20 2022, 3:16 AM
Comment Actions Rebased on top of 8378a71b6cce611e0, which needed to pull in the changes for creating the loop during VPlan. Also updated to use getPreheaderForBB in more places. fhahn added a parent revision: D123005: [VPlan] Use region for each loop in native path..Apr 3 2022, 1:42 PM
Comment Actions This looks fine! Adding a couple of nits and future thoughts:
This revision is now accepted and ready to land.Apr 4 2022, 6:56 AM fhahn marked 7 inline comments as done. Comment ActionsThanks Ayal! I addressed the latest comments and also managed to make the patch independent of the VPlan native patches. To do so, the native VPlan is made compatible with the inner loop vplan after construction and predication. fhahn removed a parent revision: D123005: [VPlan] Use region for each loop in native path..Apr 5 2022, 5:55 AM This revision was landed with ongoing or failed builds.Apr 9 2022, 5:25 AM Closed by commit rG256c6b0ba14e: [VPlan] Model pre-header explicitly. (authored by fhahn). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions I just realized I forgot to submit my responses to the latest comments. Sorry about that and here they are :)
Revision Contents
Diff 415801 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.h
llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll
llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
llvm/test/Transforms/LoopVectorize/X86/small-size.ll
llvm/test/Transforms/LoopVectorize/first-order-recurrence-sink-replicate-region.ll
llvm/test/Transforms/LoopVectorize/icmp-uniforms.ll
llvm/test/Transforms/LoopVectorize/vplan-dot-printing.ll
llvm/test/Transforms/LoopVectorize/vplan-printing.ll
llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge-vf1.ll
llvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge.ll
llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
|
Worth commenting, say in the summary, that the skeleton is left creating only the preheader and the middle-block (and the scalar loop preheader), with the "vector.body" header-block now being created by VPlan::execute?