[PATCH] D77909: [mlir][Pass] Allow duplicate pass registration.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 15:04:29 PDT 2020


rriddle created this revision.
Herald added subscribers: llvm-commits, frgossen, grosul1, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, mehdi_amini.
Herald added a project: LLVM.
rsuderman accepted this revision.
This revision is now accepted and ready to land.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77909

Files:
  mlir/lib/Pass/PassRegistry.cpp


Index: mlir/lib/Pass/PassRegistry.cpp
===================================================================
--- mlir/lib/Pass/PassRegistry.cpp
+++ mlir/lib/Pass/PassRegistry.cpp
@@ -100,9 +100,7 @@
   // 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77909.256674.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200410/0c1b4692/attachment-0001.bin>


More information about the llvm-commits mailing list