[Mlir-commits] [mlir] db9e307 - [mlir] Use a range-based for loop (NFC) (#139756)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue May 13 15:52:31 PDT 2025


Author: Kazu Hirata
Date: 2025-05-13T15:52:28-07:00
New Revision: db9e30735a39d4823624bd1fdff81673598dbdc9

URL: https://github.com/llvm/llvm-project/commit/db9e30735a39d4823624bd1fdff81673598dbdc9
DIFF: https://github.com/llvm/llvm-project/commit/db9e30735a39d4823624bd1fdff81673598dbdc9.diff

LOG: [mlir] Use a range-based for loop (NFC) (#139756)

WHile I am at it, this patch replaces std::find with
llvm::is_contained.

Added: 
    

Modified: 
    mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
index 3938c3731c47f..66ea00b23b9d4 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
@@ -444,9 +444,8 @@ LogicalResult TosaProfileCompliance::checkProfileOrExtension(
   // Ensure the profile inference match the profile knowledge of the
   // specification.
   for (const auto &cands : specRequiredModeSet) {
-    for (size_t i = 0; i < opRequiredMode.size(); i++) {
-      if (std::find(cands.begin(), cands.end(), opRequiredMode[i]) ==
-          cands.end()) {
+    for (const auto &mode : opRequiredMode) {
+      if (!llvm::is_contained(cands, mode)) {
         op->emitOpError() << "illegal: requires ["
                           << llvm::join(stringifyProfile<T>(opRequiredMode),
                                         ", ")


        


More information about the Mlir-commits mailing list