This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Generalize a couple of passes so they can operate on any FunctionLike op.
ClosedPublic

Authored by stellaraccident on Dec 13 2021, 9:33 AM.

Details

Summary
  • Generalizes passes linalg-detensorize, linalg-fold-unit-extent-dims, convert-elementwise-to-linalg.
  • I feel that more work could be done in the future (i.e. make FunctionLike into a proper OpInterface and extend actions in dialect conversion to be trait based), and this patch would be a good record of why that is useful.
  • Note for downstreams:
    • Since these passes are now generic, they do not automatically nest with pass managers set up for that.
    • If running them over nested functions, you must nest explicitly. Upstream has adopted this style but *-opt still has some uses of implicit pipelines via args. See tests for argument changes needed.

Diff Detail

Event Timeline

stellaraccident requested review of this revision.Dec 13 2021, 9:33 AM
scotttodd accepted this revision.Dec 13 2021, 11:18 AM
This revision is now accepted and ready to land.Dec 13 2021, 11:18 AM
mehdi_amini accepted this revision.Dec 13 2021, 12:02 PM

The requirement on the FunctionLike trait isn't clear to me: I'm all for making things less constrained that they artificially are, I'd just like to document the remaining restriction.

LG otherwise!

mlir/include/mlir/Dialect/Linalg/Passes.td
22

Please document the "why"

213

(since we're here...)

234

(same: please document the "why")

This revision was landed with ongoing or failed builds.Dec 13 2021, 12:02 PM
This revision was automatically updated to reflect the committed changes.

The requirement on the FunctionLike trait isn't clear to me: I'm all for making things less constrained that they artificially are, I'd just like to document the remaining restriction.

LG otherwise!

Sorry - mid-air collision on land/comments. Do you mind if I follow-up to address (after lunch)?

Seems like a test is crashing now: https://lab.llvm.org/buildbot/#/builders/61/builds/18729
I reverted in the meantime.