Skip to content

Commit e525298

Browse files
committed
Use all_of
1 parent 353adf0 commit e525298

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,13 +1364,11 @@ StringRef VPWidenIntrinsicRecipe::getIntrinsicName() const {
13641364

13651365
bool VPWidenIntrinsicRecipe::onlyFirstLaneUsed(const VPValue *Op) const {
13661366
assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
1367-
for (auto [Idx, V] : enumerate(operands())) {
1368-
if (V != Op)
1369-
continue;
1370-
if (!isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, Idx, nullptr))
1371-
return false;
1372-
}
1373-
return true;
1367+
return all_of(enumerate(operands()), [this, &Op](auto &&X) {
1368+
auto [Idx, V] = X;
1369+
return V != Op || isVectorIntrinsicWithScalarOpAtArg(getVectorIntrinsicID(),
1370+
Idx, nullptr);
1371+
});
13741372
}
13751373

13761374
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

0 commit comments

Comments
 (0)