[PATCH] D144491: [VPlan] Use isUniformAfterVec in VPReplicateRecipe::execute.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 08:37:12 PST 2023


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9609
 
-  // A store of a loop varying value to a loop invariant address only
-  // needs only the last copy of the store.
-  if (isa<StoreInst>(UI) && !getOperand(1)->hasDefiningRecipe()) {
+  // A store of a loop varying value to a uniform address only needs only the
+  // last copy of the store.
----------------
only needs a single only...


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9612
+  if (isa<StoreInst>(UI) &&
+      vputils::isUniformAfterVectorization(getOperand(1))) {
     auto Lane = VPLane::getLastLaneForVF(State.VF);
----------------
This is a bit fragile considering that isUniformAfterVectorization() in general also represents lane-varying values whose first lane need only be used, as in vector stores - see `isUniformDecision `.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144491/new/

https://reviews.llvm.org/D144491



More information about the llvm-commits mailing list