[Mlir-commits] [mlir] 33f76e2 - [mlir][Pass] Allow duplicate pass registration.

River Riddle llvmlistbot at llvm.org
Fri Apr 10 14:52:38 PDT 2020


Author: River Riddle
Date: 2020-04-10T14:49:59-07:00
New Revision: 33f76e2381b48b58c60e689a1ca2acc59fd6dfa2

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

LOG: [mlir][Pass] Allow duplicate pass registration.

Summary: With users registering their own dependencies, duplicate pass registration becomes more and more common. This revision relaxes that pass registration be unique. This is safe to assume given that we key on the passID, which is guaranteed to be unique per pass class.

Differential Revision: https://reviews.llvm.org/D77909

Added: 
    

Modified: 
    mlir/lib/Pass/PassRegistry.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index 74ac36ae8c59..69962ecd20c8 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -100,9 +100,7 @@ void mlir::registerPass(StringRef arg, StringRef description,
   // TODO: We should use the 'arg' as the lookup key instead of the pass id.
   const PassID *passID = function()->getPassID();
   PassInfo passInfo(arg, description, passID, function);
-  bool inserted = passRegistry->try_emplace(passID, passInfo).second;
-  assert(inserted && "Pass registered multiple times");
-  (void)inserted;
+  passRegistry->try_emplace(passID, passInfo);
 }
 
 /// Returns the pass info for the specified pass class or null if unknown.


        


More information about the Mlir-commits mailing list