This is an archive of the discontinued LLVM Phabricator instance.

[mlir] GreedyPatternRewriteDriver: Fix termination criteria in OpPatternRewriteDriver
ClosedPublic

Authored by springerm on Jan 17 2023, 5:09 AM.

Details

Summary

This driver should iterate until convergence or until the specified op was erased. However, it used to stop when any op was erased.

Depends On: D141920

Diff Detail

Event Timeline

springerm created this revision.Jan 17 2023, 5:09 AM
springerm requested review of this revision.Jan 17 2023, 5:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2023, 5:09 AM

Note: I found that some downstream project tests (in XLA GPU) fail with this fix. Probably due to broken rewrite patterns.

Note: I found that some downstream project tests (in XLA GPU) fail with this fix. Probably due to broken rewrite patterns.

These were indeed due to broken rewrite patterns that in some cases modified IR without going through the rewriter.

mehdi_amini accepted this revision.Jan 17 2023, 4:15 PM
mehdi_amini added inline comments.
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
494

Can you move this just before opErasedViaPatternRewrites? These are kind of working together.

This revision is now accepted and ready to land.Jan 17 2023, 4:15 PM
This revision was landed with ongoing or failed builds.Jan 18 2023, 6:15 AM
This revision was automatically updated to reflect the committed changes.
springerm marked an inline comment as done.Jan 18 2023, 6:17 AM