-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[LoopVectorize] Add cost of generating tail-folding mask to the loop #130565
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 2 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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4601,8 +4601,32 @@ VectorizationFactor LoopVectorizationPlanner::selectVectorizationFactor() { | |||||||||
| continue; | ||||||||||
|
|
||||||||||
| InstructionCost C = CM.expectedCost(VF); | ||||||||||
| VectorizationFactor Candidate(VF, C, ScalarCost.ScalarCost); | ||||||||||
|
|
||||||||||
| // Add on other costs that are modelled in VPlan, but not in the legacy | ||||||||||
| // cost model. | ||||||||||
| VPCostContext CostCtx(CM.TTI, *CM.TLI, CM.Legal->getWidestInductionType(), | ||||||||||
| CM, CM.CostKind); | ||||||||||
| if (VPRegionBlock *VectorRegion = P->getVectorLoopRegion()) { | ||||||||||
| for (VPBlockBase *Block : | ||||||||||
| vp_depth_first_shallow(VectorRegion->getEntry())) { | ||||||||||
|
||||||||||
| for (VPBlockBase *Block : | |
| vp_depth_first_shallow(VectorRegion->getEntry())) { | |
| for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(vp_depth_first_shallow(VectorRegion->getEntry())) { |
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.
Done
Outdated
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.
might be worth
| if (auto *VPI = dyn_cast<VPInstruction>(&R)) { | |
| auto *VPI = dyn_cast<VPInstruction>(&R); | |
| if (!VPI) | |
| continue |
to reduce the already high nesting level slightly
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.
Done
Large diffs are not rendered by default.
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.
at this point, I think there should always be a vector loop region?
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.
Done