Skip to content

Commit 1da2138

Browse files
committed
[pdl] Remove NoSideEffect from all PDL ops
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. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D120222
1 parent 0539a26 commit 1da2138

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define MLIR_DIALECT_PDL_IR_PDLOPS
1515

1616
include "mlir/Dialect/PDL/IR/PDLTypes.td"
17-
include "mlir/Interfaces/SideEffectInterfaces.td"
1817
include "mlir/IR/OpAsmInterface.td"
1918
include "mlir/IR/SymbolInterfaces.td"
2019

@@ -122,7 +121,7 @@ def PDL_ApplyNativeRewriteOp
122121
// pdl::AttributeOp
123122
//===----------------------------------------------------------------------===//
124123

125-
def PDL_AttributeOp : PDL_Op<"attribute", [NoSideEffect]> {
124+
def PDL_AttributeOp : PDL_Op<"attribute"> {
126125
let summary = "Define an input attribute in a pattern";
127126
let description = [{
128127
`pdl.attribute` operations capture named attribute edges into an operation.
@@ -191,7 +190,7 @@ def PDL_EraseOp : PDL_Op<"erase", [HasParent<"pdl::RewriteOp">]> {
191190
//===----------------------------------------------------------------------===//
192191

193192
def PDL_OperandOp
194-
: PDL_Op<"operand", [HasParent<"pdl::PatternOp">, NoSideEffect]> {
193+
: PDL_Op<"operand", [HasParent<"pdl::PatternOp">]> {
195194
let summary = "Define an external input operand in a pattern";
196195
let description = [{
197196
`pdl.operand` operations capture external operand edges into an operation
@@ -230,7 +229,7 @@ def PDL_OperandOp
230229
//===----------------------------------------------------------------------===//
231230

232231
def PDL_OperandsOp
233-
: PDL_Op<"operands", [HasParent<"pdl::PatternOp">, NoSideEffect]> {
232+
: PDL_Op<"operands", [HasParent<"pdl::PatternOp">]> {
234233
let summary = "Define a range of input operands in a pattern";
235234
let description = [{
236235
`pdl.operands` operations capture external operand range edges into an
@@ -501,7 +500,7 @@ def PDL_ReplaceOp : PDL_Op<"replace", [
501500
// pdl::ResultOp
502501
//===----------------------------------------------------------------------===//
503502

504-
def PDL_ResultOp : PDL_Op<"result", [NoSideEffect]> {
503+
def PDL_ResultOp : PDL_Op<"result"> {
505504
let summary = "Extract a result from an operation";
506505
let description = [{
507506
`pdl.result` operations extract result edges from an operation node within
@@ -533,7 +532,7 @@ def PDL_ResultOp : PDL_Op<"result", [NoSideEffect]> {
533532
// pdl::ResultsOp
534533
//===----------------------------------------------------------------------===//
535534

536-
def PDL_ResultsOp : PDL_Op<"results", [NoSideEffect]> {
535+
def PDL_ResultsOp : PDL_Op<"results"> {
537536
let summary = "Extract a result group from an operation";
538537
let description = [{
539538
`pdl.results` operations extract a result group from an operation within a
@@ -639,7 +638,7 @@ def PDL_RewriteOp : PDL_Op<"rewrite", [
639638
// pdl::TypeOp
640639
//===----------------------------------------------------------------------===//
641640

642-
def PDL_TypeOp : PDL_Op<"type", [NoSideEffect]> {
641+
def PDL_TypeOp : PDL_Op<"type"> {
643642
let summary = "Define a type handle within a pattern";
644643
let description = [{
645644
`pdl.type` operations capture result type constraints of `Attributes`,
@@ -668,7 +667,7 @@ def PDL_TypeOp : PDL_Op<"type", [NoSideEffect]> {
668667
// pdl::TypesOp
669668
//===----------------------------------------------------------------------===//
670669

671-
def PDL_TypesOp : PDL_Op<"types", [NoSideEffect]> {
670+
def PDL_TypesOp : PDL_Op<"types"> {
672671
let summary = "Define a range of type handles within a pattern";
673672
let description = [{
674673
`pdl.types` operations capture result type constraints of `Value`s, and

0 commit comments

Comments
 (0)