Skip to content

Commit 3bca659

Browse files
Use llvm::is_contained (NFC)
1 parent 8a7f4ee commit 3bca659

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,9 +1187,7 @@ class DSAStackTy {
11871187
if (!Top)
11881188
return false;
11891189

1190-
return llvm::any_of(Top->IteratorVarDecls, [VD](const VarDecl *IteratorVD) {
1191-
return IteratorVD == VD->getCanonicalDecl();
1192-
});
1190+
return llvm::is_contained(Top->IteratorVarDecls, VD->getCanonicalDecl());
11931191
}
11941192
/// get captured field from ImplicitDefaultFirstprivateFDs
11951193
VarDecl *getImplicitFDCapExprDecl(const FieldDecl *FD) const {

mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,8 +1514,7 @@ vectorizeLinalgOpPrecondition(LinalgOp linalgOp,
15141514
ArrayRef<int64_t> inputVectorSizes,
15151515
bool vectorizeNDExtract) {
15161516
// tensor with dimension of 0 cannot be vectorized.
1517-
if (llvm::any_of(linalgOp.getStaticShape(),
1518-
[](int64_t dim) { return dim == 0; }))
1517+
if (llvm::is_contained(linalgOp.getStaticShape(), 0))
15191518
return failure();
15201519
// Check API contract for input vector sizes.
15211520
if (!inputVectorSizes.empty() &&

mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,11 @@ LogicalResult isAllowedSizeN(int sizeN, Type typeA) {
444444
176, 192, 208, 224, 240, 256};
445445
if (typeA.isBF16() || typeA.isF16() || typeA.isTF32() ||
446446
typeA.isFloat8E4M3FN() || typeA.isFloat8E5M2())
447-
if (llvm::any_of(allowedN, [&](int n) { return sizeN == n; }))
447+
if (llvm::is_contained(allowedN, sizeN))
448448
return success();
449449

450450
if (typeA.isInteger(8) || typeA.isInteger(1))
451-
if (llvm::any_of(allowedNshort, [&](int n) { return sizeN == n; }))
451+
if (llvm::is_contained(allowedNshort, sizeN))
452452
return success();
453453
return failure();
454454
}

0 commit comments

Comments
 (0)