Skip to content

Commit 9d712d2

Browse files
authored
[MLIR][pass registry] show overlapping pass pipeline name (#70167)
Similar to #70108.
1 parent 7dad7ab commit 9d712d2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mlir/lib/Pass/PassRegistry.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <optional>
10-
#include <utility>
9+
#include "mlir/Pass/PassRegistry.h"
1110

1211
#include "mlir/Pass/Pass.h"
1312
#include "mlir/Pass/PassManager.h"
14-
#include "mlir/Pass/PassRegistry.h"
1513
#include "llvm/ADT/DenseMap.h"
1614
#include "llvm/ADT/ScopeExit.h"
1715
#include "llvm/Support/Format.h"
1816
#include "llvm/Support/ManagedStatic.h"
1917
#include "llvm/Support/MemoryBuffer.h"
2018
#include "llvm/Support/SourceMgr.h"
2119

20+
#include <optional>
21+
#include <utility>
22+
2223
using namespace mlir;
2324
using namespace detail;
2425

@@ -99,7 +100,10 @@ void mlir::registerPassPipeline(
99100
PassPipelineInfo pipelineInfo(arg, description, function,
100101
std::move(optHandler));
101102
bool inserted = passPipelineRegistry->try_emplace(arg, pipelineInfo).second;
102-
assert(inserted && "Pass pipeline registered multiple times");
103+
#ifndef NDEBUG
104+
if (!inserted)
105+
report_fatal_error("Pass pipeline " + arg + " registered multiple times");
106+
#endif
103107
(void)inserted;
104108
}
105109

0 commit comments

Comments
 (0)