This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] NFC: move conversion options out of the type converter
ClosedPublic

Authored by antiagainst on Sep 9 2022, 11:41 AM.

Details

Summary

This is a step for adding more options not directly related to type
conversion. Also with this we can now avoid the explicit constructor.

Diff Detail

Event Timeline

antiagainst created this revision.Sep 9 2022, 11:41 AM
antiagainst requested review of this revision.Sep 9 2022, 11:41 AM
kuhar added a comment.Sep 9 2022, 11:44 AM

We cannot make these pass options in .td because they are shared by multiple passes, right?

We cannot make these pass options in .td because they are shared by multiple passes, right?

These are fundamentally controls to the overall conversion. So they are now carried via the type converter, because every pattern have access to the type converter. So yes, in a sense we cannot put them in .td as pass options because all patterns would need them. What's really under the hood is that, passes in MLIR is more for testing purposes; so we expose pass options for testing mostly. Downstream users are expected to use the C++ API and thus the C++ option control, which is more clean and consistent. ;)

kuhar accepted this revision.Sep 9 2022, 12:28 PM
This revision is now accepted and ready to land.Sep 9 2022, 12:28 PM