This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Move JitRunner Options to header, pass to mlirTransformer
ClosedPublic

Authored by rengolin on Nov 11 2022, 12:29 PM.

Details

Summary

This allows the MLIR transformer to see the command line options and
make desicions based on them. No change upstream, but my use-case is to
look at the entry point name and type to make sure I can use them.

This is what I'm doing downstream:
https://github.com/rengolin/tpp-sandbox/commit/773727bc26f9598666223541adea8fa872b2ac84

Diff Detail

Event Timeline

rengolin created this revision.Nov 11 2022, 12:29 PM
rengolin requested review of this revision.Nov 11 2022, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 12:29 PM
mehdi_amini added inline comments.Nov 12 2022, 12:05 PM
mlir/include/mlir/ExecutionEngine/JitRunner.h
94

Seems to me that this is exposing "everything" here as a quick way to achieve what you need, but I'm a bit concerned that a lot of this has been "designed" as internal details of the JitRunner and not meant as an API: this may be slightly too much of a big hammer right now IMO. Can we do something more targeted to the "mlirTransformer" callback here?

rengolin added inline comments.Nov 12 2022, 1:29 PM
mlir/include/mlir/ExecutionEngine/JitRunner.h
94

I thought about that, as there are some other configurations flying around, so I could just create some externally visible struct. Right now, I only need mainFuncName and mainFuncType, so I could do that.

Given that the options are read-only anyway, it shouldn't matter much. If other people want more, they can increment later on.

I'll update and rebase.

rengolin updated this revision to Diff 474961.Nov 12 2022, 1:50 PM

Simplified what's exposed to the methods, keeping the Options on the CPP file. Rebased and all tests pass.

rengolin marked an inline comment as done.Nov 12 2022, 1:51 PM
mehdi_amini accepted this revision.Nov 13 2022, 10:48 AM
This revision is now accepted and ready to land.Nov 13 2022, 10:48 AM
This revision was landed with ongoing or failed builds.Nov 13 2022, 10:56 AM
This revision was automatically updated to reflect the committed changes.