[Mlir-commits] [mlir] [MLIR][Python] Add Python and C API of `mlir::DynamicType` (PR #182751)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Feb 22 20:03:21 PST 2026
================
@@ -85,3 +86,40 @@ MlirDynamicOpTrait mlirDynamicOpTraitCreate(
return wrap(
new mlir::ExternalDynamicOpTrait(unwrap(typeID), callbacks, userData));
}
+
+bool mlirDialectIsAExtensibleDialect(MlirDialect dialect) {
+ return llvm::isa<mlir::ExtensibleDialect>(unwrap(dialect));
+}
+
+MlirDynamicTypeDefinition
+mlirExtensibleDialectLookupTypeDefinition(MlirDialect dialect,
+ MlirStringRef typeName) {
+ return wrap(llvm::cast<mlir::ExtensibleDialect>(unwrap(dialect))
+ ->lookupTypeDefinition(unwrap(typeName)));
+}
+
+bool mlirTypeIsADynamicType(MlirType type) {
+ return llvm::isa<mlir::DynamicType>(unwrap(type));
+}
+
+MlirTypeID mlirDynamicTypeGetTypeID() {
+ return wrap(mlir::DynamicType::getTypeID());
----------------
PragmaTwice wrote:
Yah IIUC all dynamic types are instances of `mlir::DynamicType`.
https://github.com/llvm/llvm-project/pull/182751
More information about the Mlir-commits
mailing list