This is an archive of the discontinued LLVM Phabricator instance.

[mlir:PDL] Fix bugs in PDLPatternModule merging
ClosedPublic

Authored by rriddle on Nov 30 2021, 1:03 PM.

Details

Summary
  • Constraints/Rewrites registered before a pattern was added were dropped
  • Constraints/Rewrites may be registered multiple times (if different pattern sets depend on them)
  • ModuleOp no longer has a terminator, so we shouldn't be removing the terminator from it

Depends On D114815

Diff Detail

Event Timeline

rriddle created this revision.Nov 30 2021, 1:03 PM
rriddle requested review of this revision.Nov 30 2021, 1:03 PM
jpienaar added inline comments.Dec 2 2021, 6:53 AM
mlir/lib/IR/PatternMatch.cpp
185

And here you mean equivalent fn? E.g., not just exactly the same, but same functionality.

Could you add comment to document why we need to relax this from previous assert?

mlir/test/lib/Rewrite/TestPDLByteCode.cpp
104

But why is that a good thing? :) And duplicate == the duplicate will be ignored/will overwrite? (I don't see that documented on API)

rriddle updated this revision to Diff 392158.Dec 6 2021, 1:21 PM
rriddle marked 2 inline comments as done.

resolve comments

jpienaar accepted this revision.Dec 10 2021, 11:26 AM
This revision is now accepted and ready to land.Dec 10 2021, 11:26 AM
This revision was automatically updated to reflect the committed changes.