-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[VPlan] Remove no-op SCALAR-STEPS after unrolling. #123655
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
Changes from all commits
08eb47d
524b204
1202d5f
8f5a479
6b2a4bd
d704a98
a9110a3
68e10bd
49c1b87
08ad022
d9bfec8
4120bd3
9733017
08b3f2b
0aa5d80
6146511
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 |
---|---|---|
|
@@ -924,6 +924,17 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) { | |
return; | ||
} | ||
|
||
// VPScalarIVSteps can only be simplified after unrolling. VPScalarIVSteps for | ||
// part 0 can be replaced by their start value, if only the first lane is | ||
// demanded. | ||
if (auto *Steps = dyn_cast<VPScalarIVStepsRecipe>(&R)) { | ||
if (Steps->getParent()->getPlan()->isUnrolled() && Steps->isPart0() && | ||
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 the plan has been unrolled can this even be part > 0? I just wonder if instead you can simply assert 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. In general it is the other way around, unrolling introduces copies of the input recipe, one for each part. So only after unrolling recipes for different 'parts' (i.e. interleaved iterations) are introduced. |
||
vputils::onlyFirstLaneUsed(Steps)) { | ||
Steps->replaceAllUsesWith(Steps->getOperand(0)); | ||
return; | ||
} | ||
} | ||
|
||
VPValue *A; | ||
if (match(&R, m_Trunc(m_ZExtOrSExt(m_VPValue(A))))) { | ||
VPValue *Trunc = R.getVPSingleValue(); | ||
|
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.
Hi @fhahn, what I meant in one of my earlier comments was about taking everything in this patch except this new
VPScalarIVStepsRecipe
code. Then using that as a standalone PR, just to make it easier to see which tests are affected by this code and which are affected by the changes toexecutePlan
. I tested this out downstream by building everything in this patch except this code and found some tests crash at Line 962 for this recipeWIDEN ir<%mul16> = vp.mul vp<%3>, vp<%10>, vp<%7>
and the assert is: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.
Yep I was just working on that after updating to latest main, but got sidetracked before I could put up the PR. It's here now: #125926
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.
VPWidenEVL is gone now, so I removed the changes to VPlanPatternMatch from the patch again