[PATCH] D114253: [LV] Check VPValue operand instead of Cost::isUniformAfterVec (NFC).

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 28 12:31:56 PST 2021


Ayal 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()))
----------------
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.



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