Skip to content

Commit

Permalink
[VPlan] Use isUniformAfterVec in VPReplicateRecipe::execute.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fhahn committed May 19, 2023
1 parent c8eb535 commit 5590315
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5590315

Please sign in to comment.