This is an archive of the discontinued LLVM Phabricator instance.

[pdl] Remove `NoSideEffect` from all PDL ops
ClosedPublic

Authored by Mogball on Feb 20 2022, 4:32 PM.

Details

Summary

This trait results in PDL ops being erroneously CSE'd. These ops are side-effect free in the rewriter but not in the matcher (where unused values aren't allowed anyways). These ops should have a more nuanced side-effect modeling, this is fixing a bug introduced by a previous change.

Diff Detail

Event Timeline

Mogball created this revision.Feb 20 2022, 4:32 PM
Mogball requested review of this revision.Feb 20 2022, 4:32 PM

This isn't what we want though. These ops are no side effecting in some cases, and we want to preserve that.

The commit description is also only assuming the use of the ops inside of the the match portion of a pattern.

Oh, yeah. I was just reversing https://reviews.llvm.org/D117826 because that's what introduced the bug...

But we can probably have more nuanced side-effects, like these are allocating only inside matchers.

rriddle accepted this revision.Feb 20 2022, 10:16 PM

Right, I'm fine with reverting the ones that are conservatively broken, just want to make sure the description holds and we aren't treating this as what the ideal end state should be.

mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
503

Are Result operations ever side effecting? AFAICT they always produce the same result based on the given input.

This revision is now accepted and ready to land.Feb 20 2022, 10:16 PM
Mogball edited the summary of this revision. (Show Details)Feb 22 2022, 10:20 AM

Yeah, I updated the description

This revision was automatically updated to reflect the committed changes.
Mogball added inline comments.Feb 22 2022, 10:25 AM
mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
503

Oh yeah they aren't.