This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Conversion] Implement ConvertToLLVMPatternInterface for FuncDialect
ClosedPublic

Authored by springerm on Aug 10 2023, 8:31 AM.

Details

Summary

Also a new pass option ConvertToLLVMPass to populate only patterns from the specified dialects. This is needed because the existing test cases expect that only ops from certain dialects are lowered. (E.g., "arith-to-llvm" expects that only "arith" ops are lowered but not "func" ops.)

Diff Detail

Event Timeline

springerm created this revision.Aug 10 2023, 8:31 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
springerm requested review of this revision.Aug 10 2023, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 8:31 AM
springerm updated this revision to Diff 549064.Aug 10 2023, 8:58 AM

error checking

mehdi_amini added inline comments.Aug 10 2023, 10:42 PM
mlir/include/mlir/Conversion/Passes.td
30

What about calling this "filterDialects"? That's more descriptive of what it does right?

mlir/lib/Conversion/ConvertToLLVM/ConvertToLLVMPass.cpp
90

The error message does not check for the interface, or if the dialect is registered, just that it is loaded.

101–102
121

What's this comment about here?

mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
797

This one is implicitly loaded already, the interface documents it as a guarantee

springerm marked 5 inline comments as done.

address comments

mlir/lib/Conversion/ConvertToLLVM/ConvertToLLVMPass.cpp
121

deleted, this is from an earlier version of this code

mehdi_amini accepted this revision.Aug 11 2023, 12:30 AM
This revision is now accepted and ready to land.Aug 11 2023, 12:30 AM
This revision was landed with ongoing or failed builds.Aug 11 2023, 1:05 AM
This revision was automatically updated to reflect the committed changes.