This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Canonicalize] Fix command-line options
ClosedPublic

Authored by rkayaith on May 14 2022, 5:46 PM.

Details

Summary

The canonicalize command-line options currently have no effect, as the pass is
reading the pass options in its constructor, before they're actually
initialized. This results in the default values of the options always being used.

The change here moves the initialization of the GreedyRewriteConfig out of the
constructor, so that it runs after the pass options have been parsed.

Fixes #55466

Diff Detail

Event Timeline

rkayaith created this revision.May 14 2022, 5:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2022, 5:46 PM
rkayaith added inline comments.May 14 2022, 7:53 PM
mlir/lib/Transforms/Canonicalizer.cpp
53–54

I'll remove the print here, but any thoughts on how/whether to add a test for this?

rkayaith retitled this revision from Fix canonicalizer command-line options to [mlir][Canonicalize] Fix command-line options.May 14 2022, 8:04 PM
rkayaith edited the summary of this revision. (Show Details)
rkayaith published this revision for review.May 14 2022, 8:07 PM
rkayaith added a reviewer: rriddle.
rriddle added inline comments.May 15 2022, 10:33 PM
mlir/lib/Transforms/Canonicalizer.cpp
53–54

We could conceptually add a test to test-canonicalize.mlir that disables region simplification and checks to see that the simplifications don't fire?

rkayaith marked an inline comment as done.May 16 2022, 8:28 AM

I'll need some help landing this once it looks good

rriddle accepted this revision.May 16 2022, 9:43 AM
This revision is now accepted and ready to land.May 16 2022, 9:43 AM
This revision was automatically updated to reflect the committed changes.