[Mlir-commits] [mlir] [mlir] Use llvm::all_of (NFC) (PR #140464)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun May 18 11:04:01 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-openmp
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/140464.diff
3 Files Affected:
- (modified) mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp (+8-10)
- (modified) mlir/lib/Dialect/MemRef/Transforms/ExtractAddressComputations.cpp (+3-4)
- (modified) mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp (+2-3)
``````````diff
diff --git a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
index 6119097456d1f..7a0a7f86bc1e9 100644
--- a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
+++ b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
@@ -115,16 +115,14 @@ void mlir::configureOpenMPToLLVMConversionLegality(
>([&](Operation *op) {
return typeConverter.isLegal(op->getOperandTypes()) &&
typeConverter.isLegal(op->getResultTypes()) &&
- std::all_of(op->getRegions().begin(), op->getRegions().end(),
- [&](Region ®ion) {
- return typeConverter.isLegal(®ion);
- }) &&
- std::all_of(op->getAttrs().begin(), op->getAttrs().end(),
- [&](NamedAttribute attr) {
- auto typeAttr = dyn_cast<TypeAttr>(attr.getValue());
- return !typeAttr ||
- typeConverter.isLegal(typeAttr.getValue());
- });
+ llvm::all_of(op->getRegions(),
+ [&](Region ®ion) {
+ return typeConverter.isLegal(®ion);
+ }) &&
+ llvm::all_of(op->getAttrs(), [&](NamedAttribute attr) {
+ auto typeAttr = dyn_cast<TypeAttr>(attr.getValue());
+ return !typeAttr || typeConverter.isLegal(typeAttr.getValue());
+ });
});
}
diff --git a/mlir/lib/Dialect/MemRef/Transforms/ExtractAddressComputations.cpp b/mlir/lib/Dialect/MemRef/Transforms/ExtractAddressComputations.cpp
index b906c727604dc..723b4d01186f9 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/ExtractAddressComputations.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/ExtractAddressComputations.cpp
@@ -251,10 +251,9 @@ struct LoadStoreLikeOpRewriter : public OpRewritePattern<LoadStoreLikeOp> {
// to do.
SmallVector<OpFoldResult> indices =
getAsOpFoldResult(loadStoreLikeOp.getIndices());
- if (std::all_of(indices.begin(), indices.end(),
- [](const OpFoldResult &opFold) {
- return isConstantIntValue(opFold, 0);
- })) {
+ if (llvm::all_of(indices, [](const OpFoldResult &opFold) {
+ return isConstantIntValue(opFold, 0);
+ })) {
return rewriter.notifyMatchFailure(
loadStoreLikeOp, "no computation to extract: offsets are 0s");
}
diff --git a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
index c99e925a97633..0afc502c026f7 100644
--- a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
+++ b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
@@ -312,9 +312,8 @@ LogicalResult LoadNdOp::verify() {
auto trans = getTranspose().value();
// Make sure the transpose value is valid.
- bool valid = std::all_of(trans.begin(), trans.end(), [&](int t) {
- return t >= 0 && t < tdescTy.getRank();
- });
+ bool valid = llvm::all_of(
+ trans, [&](int t) { return t >= 0 && t < tdescTy.getRank(); });
if (valid)
transpose(trans, tdescShape);
``````````
</details>
https://github.com/llvm/llvm-project/pull/140464
More information about the Mlir-commits
mailing list