diff --git a/mlir/include/mlir/IR/Dialect.h b/mlir/include/mlir/IR/Dialect.h index 292c14db3f1f..73d55c2260c0 100644 --- a/mlir/include/mlir/IR/Dialect.h +++ b/mlir/include/mlir/IR/Dialect.h @@ -281,4 +281,14 @@ template struct DialectRegistration { } // namespace mlir +namespace llvm { +/// Provide isa functionality for Dialects. +template +struct isa_impl { + static inline bool doit(const ::mlir::Dialect &dialect) { + return T::getDialectNamespace() == dialect.getNamespace(); + } +}; +} // namespace llvm + #endif