[Mlir-commits] [mlir] b95028e - [mlir] Use llvm::is_contained (NFC)
Kazu Hirata
llvmlistbot at llvm.org
Sat Sep 2 12:12:22 PDT 2023
Author: Kazu Hirata
Date: 2023-09-02T12:12:12-07:00
New Revision: b95028ee2d223281a383aad16a7dfdfc3bcc8e7f
URL: https://github.com/llvm/llvm-project/commit/b95028ee2d223281a383aad16a7dfdfc3bcc8e7f
DIFF: https://github.com/llvm/llvm-project/commit/b95028ee2d223281a383aad16a7dfdfc3bcc8e7f.diff
LOG: [mlir] Use llvm::is_contained (NFC)
Added:
Modified:
mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
mlir/lib/IR/BuiltinAttributes.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index 08ecece19c0882..2abeb919d68a47 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -772,13 +772,13 @@ LogicalResult isAllowedSizeN(int sizeN, NVVM::WGMMATypes typeA) {
case mlir::NVVM::WGMMATypes::bf16:
case mlir::NVVM::WGMMATypes::e4m3:
case mlir::NVVM::WGMMATypes::e5m2:
- if (llvm::any_of(allowedN, [&](int n) { return sizeN == n; }))
+ if (llvm::is_contained(allowedN, sizeN))
return success();
break;
case mlir::NVVM::WGMMATypes::u8:
case mlir::NVVM::WGMMATypes::s8:
case mlir::NVVM::WGMMATypes::b1:
- if (llvm::any_of(allowedNshort, [&](int n) { return sizeN == n; }))
+ if (llvm::is_contained(allowedNshort, sizeN))
return success();
}
return failure();
diff --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp
index ddbebe779766d2..5f1129326f4f77 100644
--- a/mlir/lib/IR/BuiltinAttributes.cpp
+++ b/mlir/lib/IR/BuiltinAttributes.cpp
@@ -235,7 +235,7 @@ AffineMap StridedLayoutAttr::getAffineMap() const {
LogicalResult
StridedLayoutAttr::verify(function_ref<InFlightDiagnostic()> emitError,
int64_t offset, ArrayRef<int64_t> strides) {
- if (llvm::any_of(strides, [&](int64_t stride) { return stride == 0; }))
+ if (llvm::is_contained(strides, 0))
return emitError() << "strides must not be zero";
return success();
More information about the Mlir-commits
mailing list