[llvm] 5590315 - [VPlan] Use isUniformAfterVec in VPReplicateRecipe::execute.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri May 19 10:15:28 PDT 2023
Author: Florian Hahn
Date: 2023-05-19T18:15:21+01:00
New Revision: 55903151a2a505284ce3fcd955b1d394df0b55ea
URL: https://github.com/llvm/llvm-project/commit/55903151a2a505284ce3fcd955b1d394df0b55ea
DIFF: https://github.com/llvm/llvm-project/commit/55903151a2a505284ce3fcd955b1d394df0b55ea.diff
LOG: [VPlan] Use isUniformAfterVec in VPReplicateRecipe::execute.
I was unable to find a case where this actually changes generated code,
but it enables the bug fix in D144434. It also brings codegen in line
with the handling of stores to uniform addresses in the cost model
(D134460).
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D144491
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index aaa6a3bef7c8e..dab4d16d3d9ed 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9569,9 +9569,10 @@ void VPReplicateRecipe::execute(VPTransformState &State) {
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)->isLiveIn()) {
+ // A store of a loop varying value to a uniform address only needs 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),
State);
More information about the llvm-commits
mailing list