[PATCH] D116654: [LV] Use VPReplicateRecipe::isUniform instead isUniformAfterVec (NFCI).
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 5 05:14:01 PST 2022
fhahn created this revision.
fhahn added reviewers: Ayal, gilr, david-arm.
Herald added a subscriber: hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.
In scalarizeInstruction(), isUniformAfterVectorization is used to detect
cases where it is sufficient to always access the first lane. This
should map directly checking whether the operand is a uniform replicate
recipe.
As an alternative, VPTransformState::get could check for uniforms
directly, as in D91501 <https://reviews.llvm.org/D91501>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116654
Files:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2951,7 +2951,8 @@
for (auto &I : enumerate(RepRecipe->operands())) {
auto InputInstance = Instance;
VPValue *Operand = I.value();
- if (State.Plan->isUniformAfterVectorization(Operand))
+ VPReplicateRecipe *OperandR = dyn_cast<VPReplicateRecipe>(Operand);
+ if (OperandR && OperandR->isUniform())
InputInstance.Lane = VPLane::getFirstLane();
Cloned->setOperand(I.index(), State.get(Operand, InputInstance));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116654.397539.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220105/79dcfd25/attachment.bin>
More information about the llvm-commits
mailing list