Skip to content

Commit fa9e2e9

Browse files
Addressed comments
1 parent c340589 commit fa9e2e9

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,27 +1456,27 @@ class LoopVectorizationCostModel {
14561456
// iteration in scalar form.
14571457
if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) {
14581458
LLVM_DEBUG(dbgs() << "LV: Loop with VF = " << VF
1459-
<< " requires scalar epilogue: multiple exists\n");
1459+
<< " requires scalar epilogue: multiple exits\n");
14601460
return true;
14611461
}
14621462
if (VF.isVector()) {
14631463
if (InterleaveInfo.requiresScalarEpilogue()) {
14641464
// Make sure interleaved groups that require scalar epilogue will be
14651465
// widened.
1466-
for (auto *G : InterleaveInfo.getInterleaveGroups()) {
1467-
if (!G->requiresScalarEpilogue())
1468-
continue;
1469-
1470-
Instruction *I = G->getMember(0);
1471-
InstWidening Decision = getWideningDecision(I, VF);
1472-
if (Decision == CM_Interleave ||
1473-
(Decision == CM_Unknown &&
1474-
interleavedAccessCanBeWidened(G->getMember(0), VF))) {
1475-
LLVM_DEBUG(dbgs() << "LV: Loop with VF = " << VF
1476-
<< " requires scalar epilogue: interleaved group "
1477-
"requires scalar epilogue\n");
1478-
return true;
1479-
}
1466+
if (any_of(InterleaveInfo.getInterleaveGroups(), [&](auto *Group) {
1467+
if (!Group->requiresScalarEpilogue())
1468+
return false;
1469+
1470+
Instruction *I = Group->getMember(0);
1471+
InstWidening Decision = getWideningDecision(I, VF);
1472+
return Decision == CM_Interleave ||
1473+
(Decision == CM_Unknown &&
1474+
interleavedAccessCanBeWidened(I, VF));
1475+
})) {
1476+
LLVM_DEBUG(dbgs() << "LV: Loop with VF = " << VF
1477+
<< " requires scalar epilogue: interleaved group "
1478+
"requires scalar epilogue\n");
1479+
return true;
14801480
}
14811481
}
14821482
}

0 commit comments

Comments
 (0)