This is an archive of the discontinued LLVM Phabricator instance.

[mlir][func] Use the generated pass options in func to llvm.
ClosedPublic

Authored by gysit on Feb 10 2023, 6:13 AM.

Details

Summary

Update the FuncToLLVM pass to use the generated constructors and
the generated pass option struct. The hand written constructor
got out of sync after some refactorings. Using a generated constructor
and options struct ensures the everything remains in sync.

Diff Detail

Event Timeline

gysit created this revision.Feb 10 2023, 6:13 AM
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Feb 10 2023, 6:13 AM
zero9178 added inline comments.Feb 10 2023, 8:37 AM
mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h
20–21

These constructor functions will be auto generated by TableGen, although currently they do not have matching names.
The name is simply create + TableGenRecordDefName. So if you rename ConvertFuncToLLVM to ConvertFuncToLLVMPass in the td file it should create both of these two declarations and the definitions in the cpp file for you and you'll be able to delete them here.

gysit updated this revision to Diff 496511.Feb 10 2023, 9:10 AM
gysit marked an inline comment as done.

Address review comment that further simplifies the pass definition.

zero9178 accepted this revision.Feb 10 2023, 9:16 AM

LGTM!

This revision is now accepted and ready to land.Feb 10 2023, 9:16 AM
gysit updated this revision to Diff 496668.Feb 11 2023, 1:29 AM

Use Base::Base.

This revision was landed with ongoing or failed builds.Feb 11 2023, 1:33 AM
This revision was automatically updated to reflect the committed changes.
gysit reopened this revision.Feb 11 2023, 3:22 AM
This revision is now accepted and ready to land.Feb 11 2023, 3:22 AM
gysit updated this revision to Diff 496675.Feb 11 2023, 3:23 AM

Fix build bot error.

This revision was landed with ongoing or failed builds.Feb 11 2023, 3:32 AM
This revision was automatically updated to reflect the committed changes.