-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[VPlan] Compute interleave count for VPlan. #149702
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 |
---|---|---|
|
@@ -4229,7 +4229,10 @@ class VPlan { | |
/// block with multiple predecessors (one for the exit via the latch and one | ||
/// via the other early exit). | ||
bool hasEarlyExit() const { | ||
return ExitBlocks.size() > 1 || | ||
return count_if(ExitBlocks, | ||
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. Is this changed needed because you're now calling this from places where it wasn't called previously and so has to deal with potentially different CFG? It looks like you're saying having multiple exit blocks is no longer any guarantee that there is an early exit, which is a bit surprising. Do you know why this wasn't required previously? 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. Yes. Currently hasEarlyExit returns true for loops with multiple countable exits, for which we require a scalar epilogue and it should return false. When I put up the patch, there was no impact of this change, but now with the 'early-exit vectorized' statistic there is, so I put up #151718 |
||
[](VPIRBasicBlock *EB) { | ||
return EB->getNumPredecessors() != 0; | ||
}) > 1 || | ||
(ExitBlocks.size() == 1 && ExitBlocks[0]->getNumPredecessors() > 1); | ||
} | ||
|
||
|
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.
Why not
CM.foldTailWithEVL()
?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.
Using the information when possible is more accruate, as it encodes the materialized decisions and it removes uses of the legacy cost model later in the transform stages.