This is an archive of the discontinued LLVM Phabricator instance.

Optional argument for pattern rewriter max iteration count.
ClosedPublic

Authored by Augusteijn on Nov 16 2020, 10:24 AM.

Details

Summary

Some rewriters take more iterations to converge,
add a parameter to overwrite the built-in maximum iteration count.

Diff Detail

Event Timeline

Augusteijn created this revision.Nov 16 2020, 10:24 AM
Augusteijn requested review of this revision.Nov 16 2020, 10:24 AM
rriddle requested changes to this revision.Nov 16 2020, 10:55 AM

Thanks for the patch! Can you please run clang-format?

mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
19

Please avoid the use of macros for things like this.

36

Can you just add an additional overload that accepts a max iteration count? The current overload could just call that one with the default. That would remove the need for exposing the default publicly.

38

MLIR uses camelCase for variable names.

This revision now requires changes to proceed.Nov 16 2020, 10:55 AM
Augusteijn marked 3 inline comments as done.Nov 16 2020, 12:13 PM
Augusteijn added inline comments.
mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
19

clang-format does not work for me:
YAML:2:34: error: invalid boolean

AlwaysBreakTemplateDeclarations: Yes
Augusteijn marked an inline comment as done.
  1. Updating D91553: Optional argument for pattern rewriter max iteration count. #
  2. Enter a brief description of the changes included in this update.
  3. The first line is used as subject, next lines as comment. #
  4. If you intended to create a new revision, use:
  5. $ arc diff --create

Do not expose default max iteration count

mehdi_amini accepted this revision.Nov 16 2020, 2:47 PM
mehdi_amini added inline comments.
mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
19

Seems like you have an old version of clang-format.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 16 2020, 2:57 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.

I tweaked slightly the doc and the commit message:
We like to tag commit messages with "NFC" when they don't modify an existing behavior and don't include tests (this change is a bit borderline, it *could* be plumbed and tested with a pass)