This patch adds a helper to check if a recipe only uses scalars of a
given operand. This is similar to onlyFirstLaneUsed, which was
introduced earlier.
By default, onlyScalarsUsed falls back on onlyFirstLaneUsed.
Will be used by a follow-up patch.
Differential D120827
[VPlan] Helper to check if a recipe only uses scalar values of op. Authored by fhahn on Mar 2 2022, 9:00 AM.
Details This patch adds a helper to check if a recipe only uses scalars of a By default, onlyScalarsUsed falls back on onlyFirstLaneUsed. Will be used by a follow-up patch.
Diff Detail
Event TimelineComment Actions How about VPScalarIVStepsRecipe, VPBlendRecipe, VPBranchOnMaskRecipe, VPPredInstPHIRecipe, VPExpandSCEVRecipe? Is it worth distinguishing between recipes that can immediately tell they only use scalars (or only use first scalar lane) such as VPRepilcateRecipe - and those that don't care and need to check if all their users are of the former type, such as VPBlendRecipe and possibly VPPredInstPHIRecipe? Comment Actions I updated the patch to also support VPScalarIVStepsRecipe, VPPredInstPHIRecipe & VPExpandSCEVRecipe.
I am not sure if we need that at the moment, but it might be useful to have in the future if compile-time comes a concern for some analysis? Comment Actions Perhaps drop "only" - "usesScalars()" instead of "onlyScalarsUsed()"? As opposed to usesVectors. In contrast, "onlyFirstLaneUsed()" as opposed to also using 2nd, 3rd, ... VFth lanes. Comment Actions Looks good to me, with some last minor nits. Comment Actions Thanks, I'll address them in the committed version.
Will do!
| ||||||
Can drop "only" from comment too (here and below).
Add "Conservatively returns if only first (scalar) lane is used, as default" ?