Skip to content

Commit 7017311

Browse files
Use any_of instead of a loop
1 parent ca1d359 commit 7017311

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4514,11 +4514,9 @@ static bool willGenerateVectors(VPlan &Plan, ElementCount VF,
45144514
}
45154515

45164516
static bool hasReplicatorRegion(VPlan &Plan) {
4517-
for (auto *VPRB : VPBlockUtils::blocksOnly<VPRegionBlock>(
4518-
vp_depth_first_deep(Plan.getEntry())))
4519-
if (VPRB->isReplicator())
4520-
return true;
4521-
return false;
4517+
return any_of(VPBlockUtils::blocksOnly<VPRegionBlock>(
4518+
vp_depth_first_deep(Plan.getEntry())),
4519+
[](auto *VPRB) { return VPRB->isReplicator(); });
45224520
}
45234521

45244522
#ifndef NDEBUG

0 commit comments

Comments
 (0)