This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Restrict dialect doc gen to a single dialect
ClosedPublic

Authored by rriddle on May 15 2022, 4:40 PM.

Details

Summary

In the overwhelmingly majority of cases only one dialect is generated at a time
anyways, and this restriction more easily catches user error when multiple
dialects might be generated. We hit this semi-recently with the PDL dialect,
and circt+other downstream users are also actively hitting this as well.

Diff Detail

Event Timeline

rriddle created this revision.May 15 2022, 4:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2022, 4:40 PM
rriddle requested review of this revision.May 15 2022, 4:40 PM
lattner accepted this revision.May 15 2022, 5:28 PM

Nice, thank you for fixing this!

This revision is now accepted and ready to land.May 15 2022, 5:28 PM
jpienaar accepted this revision.May 15 2022, 5:43 PM

Thanks, and yes with Marius 's change for doc includes (couple months back :-)) there isn't really reason to have multiple be generated website side. Being explicit here is better.

Did none of the cmake files need to change? If I'm reading this change correctly it just bails out if no dialect is specified, and so I'd expect some to fail (well except if the default cmake config already does set this flag)

Thanks, and yes with Marius 's change for doc includes (couple months back :-)) there isn't really reason to have multiple be generated website side. Being explicit here is better.

Did none of the cmake files need to change? If I'm reading this change correctly it just bails out if no dialect is specified, and so I'd expect some to fail (well except if the default cmake config already does set this flag)

It bails if no dialect is specified and there isn't a single dialect (which matches the dialectgen handling). We realistically could always enforce the flag, but I'd need to update uses of dialect gen as well.

rriddle updated this revision to Diff 429874.May 16 2022, 3:16 PM
rriddle added a comment.EditedMay 16 2022, 3:17 PM

Did none of the cmake files need to change? If I'm reading this change correctly it just bails out if no dialect is specified, and so I'd expect some to fail (well except if the default cmake config already does set this flag)

I had to update a couple, which conveniently looked alright on the website only because the main dialect was alphabetically ordered before the one that got included. I'll try to see if in a follow up we can roll this into add_mlir_dialect, to handle all of this automatically.

This revision was landed with ongoing or failed builds.May 16 2022, 3:35 PM
This revision was automatically updated to reflect the committed changes.