[Mlir-commits] [mlir] [MLIR][pass registry] show overlapping pass pipeline name (PR #70167)

Maksim Levental llvmlistbot at llvm.org
Wed Oct 25 05:50:23 PDT 2023


https://github.com/makslevental updated https://github.com/llvm/llvm-project/pull/70167

>From f56ab9b48339e9e1da8ab73d39911608d2212832 Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Wed, 25 Oct 2023 00:50:56 -0500
Subject: [PATCH 1/2] [MLIR][pass registry] show overlapping pass

---
 mlir/lib/Pass/PassRegistry.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index e3ea5704f61d16a..b99718019ec74fd 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -99,7 +99,10 @@ void mlir::registerPassPipeline(
   PassPipelineInfo pipelineInfo(arg, description, function,
                                 std::move(optHandler));
   bool inserted = passPipelineRegistry->try_emplace(arg, pipelineInfo).second;
-  assert(inserted && "Pass pipeline registered multiple times");
+#ifndef NDEBUG
+  if (!inserted)
+    report_fatal_error("Pass pipeline " + arg + " registered multiple times");
+#endif
   (void)inserted;
 }
 

>From 585e6ad9e2a538c974b2023e3a639615c5c0c841 Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Wed, 25 Oct 2023 07:48:24 -0500
Subject: [PATCH 2/2] reorder headers to match convention

---
 mlir/lib/Pass/PassRegistry.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index b99718019ec74fd..b0c314369190a40 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -6,12 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <optional>
-#include <utility>
+#include "mlir/Pass/PassRegistry.h"
 
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"
-#include "mlir/Pass/PassRegistry.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/Support/Format.h"
@@ -19,6 +17,9 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/SourceMgr.h"
 
+#include <optional>
+#include <utility>
+
 using namespace mlir;
 using namespace detail;
 



More information about the Mlir-commits mailing list