[PATCH] D114253: [LV] Check VPValue operand instead of Cost::isUniformAfterVec (NFC).
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 29 02:21:54 PST 2021
fhahn marked an inline comment as done.
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3173
+ VPValue *Op = I.value();
+ auto RepR = dyn_cast_or_null<VPReplicateRecipe>(Op->getDef());
+ if (!Op->getDef() || (RepR && RepR->isUniform()))
----------------
Ayal wrote:
> Whether a VPValue is "uniform after vectorization" or not should probably be a property of VPValue. Currently this can indeed be detected in VPlan by checking if it has no recipe, or has a uniform replicating recipe. Worth wrapping in a method or function? Its implementation may change when VPValues obtain "type" information and/or when additional scalar recipes may be introduced.
>
> Current patch is ok, as a temporary step; would be good to add a comment.
>
> `Op` may be confused with Operation; perhaps the original `Operand` would be better.
> `RepR` may be confused with `RepRecipe`; perhaps `OperandRepR` would be better.
>
> Whether a VPValue is "uniform after vectorization" or not should probably be a property of VPValue
Good point! I move the check logic to `VPlan::isUniformAfterVectorization`, to avoid tying this directly to the information available for a VPV. Was this what you had in mind by moving it into a function?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114253/new/
https://reviews.llvm.org/D114253
More information about the llvm-commits
mailing list