Skip to content

Commit 6b5987e

Browse files
committed
fixup! Revert "[LV] Vectorize Epilogues for loops with small VF but high IC (llvm#108190)"
1 parent d24df56 commit 6b5987e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4643,11 +4643,10 @@ bool LoopVectorizationCostModel::isEpilogueVectorizationProfitable(
46434643
return false;
46444644

46454645
unsigned Multiplier = 1;
4646-
if (VF.isScalable())
4647-
Multiplier = getVScaleForTuning(TheLoop, TTI).value_or(1);
4648-
if ((Multiplier * VF.getKnownMinValue()) >= EpilogueVectorizationMinVF)
4649-
return true;
4650-
return false;
4646+
unsigned MinVFThreshold = EpilogueVectorizationMinVF.getNumOccurrences() > 0
4647+
? EpilogueVectorizationMinVF
4648+
: TTI.getEpilogueVectorizationMinVF();
4649+
return getEstimatedRuntimeVF(TheLoop, TTI, VF * Multiplier) >= MinVFThreshold;
46514650
}
46524651

46534652
VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(

0 commit comments

Comments
 (0)