Skip to content

Commit b18506c

Browse files
committed
resolve review comments
1 parent ab7a404 commit b18506c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4378,20 +4378,20 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
43784378
bool ScalableTC = match(TC, m_scev_Mul(m_SCEV(KnownMinTC), m_SCEVVScale())) ||
43794379
match(TC, m_scev_Mul(m_SCEVVScale(), m_SCEV(KnownMinTC)));
43804380
// Use versions of TC and VF in which both are either scalable or fixed.
4381-
if (ScalableTC == MainLoopVF.isScalable()) {
4381+
if (ScalableTC == MainLoopVF.isScalable())
43824382
RemainingIterations =
43834383
SE.getURemExpr(TC, SE.getElementCount(TCType, MainLoopVF * IC));
4384-
} else {
4385-
if (ScalableTC)
4386-
RemainingIterations = SE.getURemExpr(
4387-
KnownMinTC, SE.getElementCount(TCType, MainLoopVF * IC));
4388-
else
4389-
RemainingIterations = SE.getURemExpr(
4390-
TC, SE.getElementCount(TCType, EstimatedRuntimeVF * IC));
4391-
}
4384+
else if (ScalableTC) {
4385+
const SCEV *EstimatedTC = SE.getMulExpr(
4386+
KnownMinTC, SE.getConstant(TCType, CM.getVScaleForTuning().value()));
4387+
RemainingIterations = SE.getURemExpr(
4388+
EstimatedTC, SE.getElementCount(TCType, MainLoopVF * IC));
4389+
} else
4390+
RemainingIterations =
4391+
SE.getURemExpr(TC, SE.getElementCount(TCType, EstimatedRuntimeVF * IC));
43924392

43934393
// No iterations left to process in the epilogue.
4394-
if (!RemainingIterations || RemainingIterations->isZero())
4394+
if (RemainingIterations->isZero())
43954395
return Result;
43964396

43974397
if (MainLoopVF.isFixed()) {

llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
target triple = "aarch64-linux-gnu"
1111

1212
; DEBUG: LV: Checking a loop in 'main_vf_vscale_x_16'
13+
; DEBUG-NOT: Create Skeleton for epilogue vectorized loop (first pass)
1314
; DEBUG: Executing best plan with VF=vscale x 16, UF=2
1415

1516
; DEBUG-FORCED: LV: Checking a loop in 'main_vf_vscale_x_16'

0 commit comments

Comments
 (0)