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

Maksim Levental llvmlistbot at llvm.org
Tue Oct 24 22:51:38 PDT 2023


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

Similar to https://github.com/llvm/llvm-project/pull/70108.

>From 94aa46b9998180719c65285d50ed7bc689ec311c 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] [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 3d10fe14d43d9ef..064c08186f2cf95 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;
 }
 



More information about the Mlir-commits mailing list