From: River Riddle Date: Fri, 10 Apr 2020 21:49:44 +0000 (-0700) Subject: [mlir][Pass] Allow duplicate pass registration. X-Git-Tag: llvmorg-12-init~9385 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33f76e2381b48b58c60e689a1ca2acc59fd6dfa2;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp index 74ac36a..69962ec 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.