[Mlir-commits] [mlir] [mlir] Method to iterate over registered operations for a given dialect class. (PR #112344)
Mehdi Amini
llvmlistbot at llvm.org
Wed Oct 16 12:14:51 PDT 2024
================
@@ -976,12 +994,19 @@ void RegisteredOperationName::insert(
"operation name registration must be successful");
// Add emplaced operation name to the sorted operations container.
+ StringRef dialectClass = impl->getDialect()->getNamespace();
+ ctxImpl.getCountByDialectName[dialectClass] += 1;
+
RegisteredOperationName &value = emplaced.first->second;
ctxImpl.sortedRegisteredOperations.insert(
llvm::upper_bound(ctxImpl.sortedRegisteredOperations, value,
[](auto &lhs, auto &rhs) {
- return lhs.getIdentifier().compare(
- rhs.getIdentifier());
+ if (lhs.getDialect().getNamespace() ==
+ rhs.getDialect().getNamespace())
+ return lhs.getIdentifier().compare(
+ rhs.getIdentifier());
+ return lhs.getDialect().getNamespace().compare(
+ rhs.getDialect().getNamespace());
----------------
joker-eph wrote:
Can you walk me through a concrete example where the existing code does not work and this is needed?
https://github.com/llvm/llvm-project/pull/112344
More information about the Mlir-commits
mailing list