This is an archive of the discontinued LLVM Phabricator instance.

[mlir][GreedyPatternRewriter] Add out param to detect changes in IR in `applyPatternsAndFoldGreedily`
ClosedPublic

Authored by JoelWee on Jun 28 2023, 8:34 AM.

Details

Summary

This allows users of applyPatternsAndFoldGreedily to detect if any MLIR changes have occurred. An example use-case is where we expect the applyPatternsAndFoldGreedily to change the IR and want to validate that it indeed does change it.

Diff Detail

Event Timeline

JoelWee created this revision.Jun 28 2023, 8:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 8:34 AM
JoelWee requested review of this revision.Jun 28 2023, 8:34 AM
JoelWee retitled this revision from Summary: Add out params to detect changes in IR in `applyPatternsAndFoldGreedily` to [mlir][GreedyPatternRewriter] Add out param to detect changes in IR in `applyPatternsAndFoldGreedily`.Jun 28 2023, 9:17 AM
JoelWee edited the summary of this revision. (Show Details)
JoelWee added reviewers: mehdi_amini, springerm.
JoelWee updated this revision to Diff 535449.Jun 28 2023, 9:50 AM

Fix variable naming

mehdi_amini accepted this revision.Jun 28 2023, 11:14 AM
mehdi_amini added inline comments.
mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
126

Nit: remove trivial braces here.

This revision is now accepted and ready to land.Jun 28 2023, 11:14 AM
JoelWee marked an inline comment as done.Jun 29 2023, 3:16 AM

Thank you for the review!

springerm accepted this revision.Jun 29 2023, 3:53 AM