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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 07:35:24 PST 2023


fhahn created this revision.
fhahn added reviewers: Ayal, gilr, rengolin, reames.
Herald added subscribers: StephenFan, tschuett, psnobl, rogfer01, bollu, hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added subscribers: pcwang-thead, vkmr.
Herald added a project: LLVM.

I was unable to find a case where this actually changes generated code,
but it enables the bug fix in D144434 <https://reviews.llvm.org/D144434>. It also brings codegen in line
with the handling of stores to uniform addresses in the cost model
(D134460 <https://reviews.llvm.org/D134460>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144491

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
@@ -9606,9 +9606,10 @@
     return;
   }
 
-  // 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.
+  if (isa<StoreInst>(UI) &&
+      vputils::isUniformAfterVectorization(getOperand(1))) {
     auto Lane = VPLane::getLastLaneForVF(State.VF);
     State.ILV->scalarizeInstruction(UI, this, VPIteration(State.UF - 1, Lane), IsPredicated,
                                     State);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144491.499173.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230221/90e64088/attachment-0001.bin>


More information about the llvm-commits mailing list