-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VPlan] Document current status. #85689
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,6 +19,49 @@ candidates. It serves for both optimizing candidates including estimating their | |||||
cost reliably, and for performing their final translation into IR. This | ||||||
facilitates dealing with multiple vectorization candidates. | ||||||
|
||||||
Current Status | ||||||
============== | ||||||
VPlan is currently used to drive code-generation in LoopVectorize. VPlans are | ||||||
constructed after all cost-based and most legality-related decisions have been | ||||||
taken. As def-use chains between recipes are now fully modeled in VPlan, | ||||||
VPlan-based analyses and transformations are used to simplify and modularize | ||||||
the vectorization process [10]_. Those include transformations to | ||||||
|
||||||
1. Legalize the initial VPlan, e.g. by introducing specializedrecipes for | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. specializedrecipes -> specialized recipes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed, thanks! |
||||||
reductions and interleave groups. | ||||||
|
||||||
2. Optimize the legalized VPlan, e.g. by removing redundant recipes or | ||||||
introducing active-lane-masks. | ||||||
. | ||||||
3. Apply unroll- and vectorization-factor specific optimizations, e.g. removing | ||||||
the branch to exit the vector loop based on VF & UF. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adjusted. thanks! |
||||||
|
||||||
Refer to :numref:`fig-vplan-transform-pipeline` for a overview of the current | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed , thanks! |
||||||
transformation pipeline. | ||||||
|
||||||
Note that some legality checks are already done in VPlan, including checking if | ||||||
all users of a fixed-order recurrence can be re-ordered. This is implemented as | ||||||
a VPlan-to-VPlan transformation that either applies a valid re-ordering or | ||||||
bails out marking the VPlan as invalid. | ||||||
|
||||||
.. _fig-vplan-transform-pipeline: | ||||||
.. figure:: ./vplan-transform-pipeline.png | ||||||
:width: 800 px | ||||||
|
||||||
VPlan Transformation Pipeline in 2024 | ||||||
|
||||||
|
||||||
VPlan currently models the complete vector loop, as well as other parts of the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adjusted, thanks! |
||||||
vectorization skeleton. Refer to :numref:`fig-vplan-scope` for an overview of | ||||||
the scope covered by VPlan. | ||||||
|
||||||
.. _fig-vplan-scope: | ||||||
.. figure:: ./vplan-scope.png | ||||||
:width: 800 px | ||||||
|
||||||
Scope modeled in VPlan in 2024 | ||||||
|
||||||
|
||||||
High-level Design | ||||||
================= | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we're here, worth also updating the following: ... BTW, it seems that VPRecipesBase::mayReadFromMemory() and mayWriteToMemory() are missing a The Planning Process and VPlan RoadmapTransforming the Loop Vectorizer to use VPlan follows a staged approach. First, |
||||||
|
@@ -248,3 +291,6 @@ References | |||||
|
||||||
.. [9] "Extending LoopVectorizer: OpenMP4.5 SIMD and Outer Loop | ||||||
Auto-Vectorization", Intel Vectorizer Team, LLVM Developers' Meeting 2016. | ||||||
|
||||||
.. [10] "VPlan: Status Update and Future Roadmap", Florian Hahn, LLVM | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed originally, should be addressed in 309a881 |
||||||
Developers' Meeting 2023, https://www.youtube.com/watch?v=SzGP4PgMuLE |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,6 +222,7 @@ | |
# If false, no module index is generated. | ||
# latex_domain_indices = True | ||
|
||
numfig = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can you add a comment describing the purpose of enabling this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed originally, should be addressed in 309a881 |
||
|
||
# -- Options for manual page output -------------------------------------------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is my understanding that we build VPlans and then we determine the cost of each VPlan we have built to find the best VPlan. I haven't had a chance to work in LV for a few months now so I am not so familiar with recent changes. Did we move away from this, or are you describing a different kind of cost decisions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Costs are computed first, when building a VPlan they are used to make decision (what to widen, what to scalarize and so on). After building the VPlans, the best VF is chosen using the legacy cost model, but that may soon change.