Skip to content

[mlir python] Dis-aggregating MLIRPythonExtension.Core #56037

@mikeurbach

Description

@mikeurbach

Since the work last year to refactor how MLIR Python extensions are linked, we have had this comment about dis-aggregating MLIRPythonExtension.Core:

MLIRCAPIRegistration # TODO: See about dis-aggregating

My understanding is this dependency on MLIRCAPIRegistration is pulling in all the MLIR dialects, translations, and conversions:

# Dialect registration.
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
add_mlir_upstream_c_api_library(MLIRCAPIRegistration
Registration.cpp
LINK_LIBS PUBLIC
MLIRCAPIIR
MLIRLLVMToLLVMIRTranslation
${dialect_libs}
${translation_libs}
${conversion_libs}
)

Some downstream projects may not want all of that, and may just want to depend on the "core" MLIR Python extension. This is definitely the case in the CIRCT project.

I wanted to open an issue before diving in to see if anyone has thoughts about how to go about this.

cc @stellaraccident

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions