This is an archive of the discontinued LLVM Phabricator instance.

[mlir][memref][transform] Add memref_to_llvm conversion patterns
AbandonedPublic

Authored by springerm on Aug 7 2023, 5:59 AM.

Details

Summary

These patterns are exposed via a new "apply_conversion_patterns" op.

Also provide a new type converter that converts from memref to LLVM types. Conversion patterns that lower to LLVM are special: they require an LLVMTypeConverter; a normal TypeConverter is not enough. This revision also adds a new interface method to pattern descriptor ops to verify that the default type converter of the enclosing "apply_conversion_patterns" op is compatible with the set of patterns. At the moment, a simple StringRef is used. This can evolve to a richer type in the future if needed.

Diff Detail

Event Timeline

springerm created this revision.Aug 7 2023, 5:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 5:59 AM
springerm requested review of this revision.Aug 7 2023, 5:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 5:59 AM
nicolasvasilache accepted this revision.Aug 8 2023, 1:45 AM
nicolasvasilache added inline comments.
mlir/test/Dialect/MemRef/transform-ops.mlir
275

can we make the syntax a bit more idiomatic here? E.g.

with type_converter = {

}
This revision is now accepted and ready to land.Aug 8 2023, 1:45 AM
springerm updated this revision to Diff 548123.Aug 8 2023, 2:29 AM
springerm marked an inline comment as done.

address comments

springerm abandoned this revision.Aug 9 2023, 2:31 AM

The type converter related part are folded into D157369. The memref patterns op is no longer needed. We can use ConvertToLLVMPatternInterface. I'm going to add a transform op that queries that interface.