-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[VPlan] Add additional guiding principles to docs. #85688
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -88,6 +88,33 @@ The design of VPlan follows several high-level guidelines: | |
detection and formation involves searching for and optimizing instruction | ||
patterns. | ||
|
||
8. The adoption of VPlan components should be done as a gradual, always-on | ||
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. Not sure I read this correctly, but "always-on refactoring" sounds like "adding ad-hoc changes to adopt some component".
for (int32_t i = 0; i < e; ++i) {
red += b[i];
} for peel + main loops vectorization can be represented as:
That said, having couple different examples of "ideal" representation of cases that VPlan should eventually address in the document will be great. |
||
refactoring to retain quality and integrate continuously. | ||
|
||
9. Gradually refactor into multiple VPlan-to-VPlan transforms to reduce | ||
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. Can you please elaborate "reduce complexity" part ? Is it just complexity in terms of building and executing VPlan or something else ? 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. If I understand correctly rest of it, i.e. initial VPlan should be constructed as-is and all optimizations on it should be done by transforms (optimizations), that looks good. However, I'm also trying to map that point to #82270. Can you please also elaborate which of these principles explains moving canonical iv construction to |
||
complexity: | ||
|
||
a. Simplify initial VPlan construction, by moving complexity to | ||
transformations (e.g. adjusting fixed-order recurrences as separate | ||
transformation) | ||
|
||
b. Canonicalize then specialize: initial VPlans and early transformations | ||
should operate on canonical, target-independent VPlans, to enable general | ||
transformations. Target-specific concepts and specialization should be | ||
introduced closer to VPlan execution (e.g. introduction of | ||
active-lane-mask as VPlan-to-VPlan transformation). | ||
|
||
c. Simplify VPlan execution: reduce the complexity of recipes' *::execute* | ||
implementations by breaking up complex recipes and model them more | ||
accurately in VPlan. Employ gradual lowering to avoid unnecessary | ||
complexity early on and keep canonical VPlans consice by modeling | ||
concepts using abstract recipes. Lower or expand such abstract recipes | ||
before code-gen to a series of simpler, concrete recipes with simple | ||
*::execute* implementations (e.g. using predicated *VPReplicateRecipes* in | ||
the early stages of the pipeline, which later get expanded to replicate | ||
regions; this simplifes a number of transformations, including sinking, by | ||
avoiding having to deal with replicate regions). | ||
|
||
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. Couple more questions/clarifications I'd like to ask:
|
||
Definitions | ||
=========== | ||
The low-level design of VPlan comprises of the following classes. | ||
|
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.
nit: cannot comment on a line 86, but I assume
Step 2.b
should really beStep 2.ii