This is an archive of the discontinued LLVM Phabricator instance.

[mlir-reduce] Support parsing operations other than 'builtin.module' as top-level
ClosedPublic

Authored by rkayaith on Sep 19 2022, 4:38 PM.

Details

Summary

This adds a --no-implicit-module option, which disables the insertion
of a top-level builtin.module during parsing. Although other ops can
now be parsed as top-level, the actual reduction passes are still
restricted to builtin.module as it didn't seem straightforward to
update them.

Diff Detail

Event Timeline

rkayaith created this revision.Sep 19 2022, 4:38 PM
rkayaith published this revision for review.Sep 19 2022, 10:30 PM
rriddle accepted this revision.Oct 3 2022, 12:15 AM
rriddle added inline comments.
mlir/lib/Reducer/ReductionTreePass.cpp
221–224
mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
31–42

Can we change this function to just return an OwningOpRef<Operation *>? Using nullptr for failure?

This revision is now accepted and ready to land.Oct 3 2022, 12:15 AM
rkayaith updated this revision to Diff 464773.Oct 3 2022, 12:34 PM
rkayaith marked 2 inline comments as done.
rkayaith retitled this revision from [mlir-reduce] Support parsing ops other than 'builtin.module' as top-level to [mlir-reduce] Support parsing operations other than 'builtin.module' as top-level.
rkayaith edited the summary of this revision. (Show Details)

address comments

This revision was landed with ongoing or failed builds.Oct 3 2022, 1:16 PM
This revision was automatically updated to reflect the committed changes.
aartbik added inline comments.Oct 3 2022, 2:31 PM
mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
25

bazel file missing, again

rkayaith added inline comments.Oct 3 2022, 2:46 PM
mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
25

is it expected that all MLIR changes should update the bazel files as well? i was under the impression that the bazel files were maintained separately by bazel users.

aartbik added inline comments.Oct 3 2022, 2:48 PM
mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
25

No I don't think there is a general expectation for this. I think today I am the lucky bazel user that needs to keep this consistent ;-)

rriddle added inline comments.Oct 3 2022, 2:52 PM
mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
25

There is no requirement to update bazel, it's a best effort done only by bazel users.