InnerLoopVectorizer's code called during VPlan execution still relies on original IR's def-use relations to decide which vector code to generate, limiting VPlan transformations ability to modify def-use relations and still have ILV generate the vector code.
This commit introduces VPValues for VPBlendRecipe to use as the values to blend. The recipe is generated with VPValues wrapping the phi's incoming values of the scalar phi. This reduces ingredient def-use usage by ILV as a step towards full VPlan-based def-use relations.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
minor comments, looks good to me, thanks.
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
6895 | This matches current behavior, as an NFCI patch should. Suggest as a follow-up to remove the assert and replace this with something like VPValue *IncomingValue = Plan->getOrAddVPValue(Phi->getIncomingValue(In)); if (!EdgeMask) return new VPBlendRecipe(Phi, {IncomingValue}): Operands.push_back(IncomingValue); Operands.push_back(EdgeMask); which assures that the number of operands will be either one or even (still need to assert it isn't 2), and fixes PR44800 as @fhahn commented. | |
7442 | Have the recipe provide interfaces for getNumIncomingValues(), getIncomingValue(predecessor#), getMask(predecessor#), hiding their interleaved storage layout? | |
llvm/lib/Transforms/Vectorize/VPlan.h | ||
916 | "... an even number of operands"[, excluding 2] |
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
7447 | nit: better set NumIncoming = getNumIncomingValues() once and iterate until In < NumIncoming, as done below in print(). |
Hi!
I wrote
https://bugs.llvm.org/show_bug.cgi?id=45525
for a crash that started appearing with this patch.
This matches current behavior, as an NFCI patch should.
Suggest as a follow-up to remove the assert and replace this with something like
which assures that the number of operands will be either one or even (still need to assert it isn't 2), and fixes PR44800 as @fhahn commented.