This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Transform] Add support to drive conversions of func to LLVM with TD
ClosedPublic

Authored by nicolasvasilache on Aug 9 2023, 3:29 PM.

Details

Summary

This revision adds a transform.apply_conversion_patterns.func.func_to_llvm transformation.

It is unclear at this point whether this should be spelled out as a standalone transformation
or whether it should resemble transform.apply_conversion_patterns.dialect_to_llvm "fun".

This is dependent on how we want to handle the type converter creation.
In particular the current implementation exhibits the fact that
transform.apply_conversion_patterns.memref.memref_to_llvm_type_converter was not rich enough
and did not match the LowerToLLVMOptions.

Keeping those options in sync across all the passes that lower to LLVM is very error prone.
Instead, we should have a single to_llvm_type_converter.

Diff Detail

Event Timeline

Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
nicolasvasilache requested review of this revision.Aug 9 2023, 3:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 3:29 PM

Add a (currently failing) transform with data_layout

Attempt to apply partial conversion without failures, this is currently unsuccesful.

nicolasvasilache edited the summary of this revision. (Show Details)

Rebase

springerm accepted this revision.Aug 10 2023, 5:44 AM
This revision is now accepted and ready to land.Aug 10 2023, 5:44 AM
nicolasvasilache retitled this revision from [mlir][Transform] WIP Add support to drive conversions of func to LLVM with TD to [mlir][Transform] Add support to drive conversions of func to LLVM with TD.
nicolasvasilache edited the summary of this revision. (Show Details)

Fix test and rebase

There is some followup here to better layer this with @mehdi_amini 's work and deciding whether we indeed want a new transform.apply_conversion_patterns.func.func_to_llvm or whether we prefer
transform.apply_conversion_patterns.dialect_to_llvm "llvm" but in the meantime this allows progress.

This revision was landed with ongoing or failed builds.Aug 10 2023, 6:31 AM
This revision was automatically updated to reflect the committed changes.