[Mlir-commits] [mlir] The implementation would crash with unloaded dialects. (PR #108249)

Matteo Franciolini llvmlistbot at llvm.org
Wed Sep 11 09:56:03 PDT 2024


https://github.com/mfrancio created https://github.com/llvm/llvm-project/pull/108249

The implementation would crash with unloaded dialects.


>From 50dc3d7f770f1c8198a4a86ccdf329cb79ddbfc6 Mon Sep 17 00:00:00 2001
From: Matteo Franciolini <mfranciolini at tesla.com>
Date: Wed, 11 Sep 2024 09:51:28 -0700
Subject: [PATCH] [mlir][bufferization] Fix OpFilter::denyDialect.

The implementation would crash with unloaded dialects.
---
 .../mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
index 2fda091e412aef..aceb9d059b95f3 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
@@ -152,7 +152,7 @@ class OpFilter {
   /// This function adds a DENY entry.
   void denyDialect(StringRef dialectNamespace) {
     Entry::FilterFn filterFn = [=](Operation *op) {
-      return op->getDialect()->getNamespace() == dialectNamespace;
+      return op->getName().getDialectNamespace() == dialectNamespace;
     };
     entries.push_back(Entry{filterFn, Entry::FilterType::DENY});
   }



More information about the Mlir-commits mailing list