This removes the remaining dependence on LoopVectorizationCostModel from
buildScalarSteps and is required so it can be moved out of ILV.
It also improves allows us to remove a few unneeded instructions.
Paths
| Differential D116554
[VPlan] Use VPlan to check if only the first lane is used. ClosedPublic Authored by fhahn on Jan 3 2022, 1:07 PM.
Details Summary This removes the remaining dependence on LoopVectorizationCostModel from It also improves allows us to remove a few unneeded instructions.
Diff Detail
Event TimelineHerald added subscribers: tschuett, psnobl, rogfer01 and 2 others. · View Herald TranscriptJan 3 2022, 1:07 PM fhahn added a child revision: D115953: [VPlan] Introduce recipe to build scalar steps..Jan 3 2022, 1:08 PM david-arm added inline comments.
fhahn added a child revision: D116656: [LV] Use onlyFirstLaneDemanded when widening pointer phis (NFCI)..Jan 5 2022, 5:15 AM Comment Actions Address comments, thanks! Move to namespace and also consider VPWidenMemoryInstructionRecipes as uniform, if they are consecutive and the def is used as pointer only. fhahn added inline comments.
Comment Actions Worth having RecipeBase indicate if it's using first lane only, per operand and/or for all operands, in order to associate this logic within each recipe? UAV is propagated at the outset and its results are encoded in isUniform replicating recipes upon VPlan construction; should Blend recipe also record if it's blending uniform values or not, when constructed, instead of looking through it recursively here? fhahn marked 2 inline comments as done. Comment Actions
I moved the helpers to D116123 so they can be used there to start with. I also applied the suggestion there and removed the definitions here. Unfortunately the change here cannot be applied before D116123 because it requires separating out the step-vector part from the induction recipes first.
I am not sure if it is worth adding a new field at the moment, given that it should be very cheap to find out given the existing information and it reduces the amount of state we need to carry. I think it might be good as a follow-up, which can also use it during codegen of the recipe, so we only generate a scalar select. fhahn retitled this revision from [VPlan] Add & use utility to check if only the first lane is used. to [VPlan] Use VPlan to check if only the first lane is used..Jan 16 2022, 7:57 AM Comment Actions This looks fine, with a minor comment.
This revision is now accepted and ready to land.Jan 18 2022, 10:27 AM Comment Actions Thank Ayal! I rebased the patch and remove the stale comment about EntryVal. I plan to land the change soon. This revision was landed with ongoing or failed builds.Jan 30 2022, 5:08 AM Closed by commit rG8f12175fedd2: [VPlan] Use VPlan to check if only the first lane is used. (authored by fhahn). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 404365 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/X86/conversion-cost.ll
llvm/test/Transforms/LoopVectorize/X86/uniform_mem_op.ll
llvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
llvm/test/Transforms/LoopVectorize/loop-form.ll
|
Update comment as EntryVal is no longer checked? In fact, it need not be passed in.