[Mlir-commits] [mlir] 1da2138 - [pdl] Remove `NoSideEffect` from all PDL ops
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Feb 22 10:21:04 PST 2022
Author: Mogball
Date: 2022-02-22T18:20:59Z
New Revision: 1da213836b43e5c646a82a1e0e191aee7836e37e
URL: https://github.com/llvm/llvm-project/commit/1da213836b43e5c646a82a1e0e191aee7836e37e
DIFF: https://github.com/llvm/llvm-project/commit/1da213836b43e5c646a82a1e0e191aee7836e37e.diff
LOG: [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
Added:
Modified:
mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
index 0c35d0457d845..1d4264eeb9857 100644
--- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
+++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
@@ -14,7 +14,6 @@
#define MLIR_DIALECT_PDL_IR_PDLOPS
include "mlir/Dialect/PDL/IR/PDLTypes.td"
-include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/IR/OpAsmInterface.td"
include "mlir/IR/SymbolInterfaces.td"
@@ -122,7 +121,7 @@ def PDL_ApplyNativeRewriteOp
// pdl::AttributeOp
//===----------------------------------------------------------------------===//
-def PDL_AttributeOp : PDL_Op<"attribute", [NoSideEffect]> {
+def PDL_AttributeOp : PDL_Op<"attribute"> {
let summary = "Define an input attribute in a pattern";
let description = [{
`pdl.attribute` operations capture named attribute edges into an operation.
@@ -191,7 +190,7 @@ def PDL_EraseOp : PDL_Op<"erase", [HasParent<"pdl::RewriteOp">]> {
//===----------------------------------------------------------------------===//
def PDL_OperandOp
- : PDL_Op<"operand", [HasParent<"pdl::PatternOp">, NoSideEffect]> {
+ : PDL_Op<"operand", [HasParent<"pdl::PatternOp">]> {
let summary = "Define an external input operand in a pattern";
let description = [{
`pdl.operand` operations capture external operand edges into an operation
@@ -230,7 +229,7 @@ def PDL_OperandOp
//===----------------------------------------------------------------------===//
def PDL_OperandsOp
- : PDL_Op<"operands", [HasParent<"pdl::PatternOp">, NoSideEffect]> {
+ : PDL_Op<"operands", [HasParent<"pdl::PatternOp">]> {
let summary = "Define a range of input operands in a pattern";
let description = [{
`pdl.operands` operations capture external operand range edges into an
@@ -501,7 +500,7 @@ def PDL_ReplaceOp : PDL_Op<"replace", [
// pdl::ResultOp
//===----------------------------------------------------------------------===//
-def PDL_ResultOp : PDL_Op<"result", [NoSideEffect]> {
+def PDL_ResultOp : PDL_Op<"result"> {
let summary = "Extract a result from an operation";
let description = [{
`pdl.result` operations extract result edges from an operation node within
@@ -533,7 +532,7 @@ def PDL_ResultOp : PDL_Op<"result", [NoSideEffect]> {
// pdl::ResultsOp
//===----------------------------------------------------------------------===//
-def PDL_ResultsOp : PDL_Op<"results", [NoSideEffect]> {
+def PDL_ResultsOp : PDL_Op<"results"> {
let summary = "Extract a result group from an operation";
let description = [{
`pdl.results` operations extract a result group from an operation within a
@@ -639,7 +638,7 @@ def PDL_RewriteOp : PDL_Op<"rewrite", [
// pdl::TypeOp
//===----------------------------------------------------------------------===//
-def PDL_TypeOp : PDL_Op<"type", [NoSideEffect]> {
+def PDL_TypeOp : PDL_Op<"type"> {
let summary = "Define a type handle within a pattern";
let description = [{
`pdl.type` operations capture result type constraints of `Attributes`,
@@ -668,7 +667,7 @@ def PDL_TypeOp : PDL_Op<"type", [NoSideEffect]> {
// pdl::TypesOp
//===----------------------------------------------------------------------===//
-def PDL_TypesOp : PDL_Op<"types", [NoSideEffect]> {
+def PDL_TypesOp : PDL_Op<"types"> {
let summary = "Define a range of type handles within a pattern";
let description = [{
`pdl.types` operations capture result type constraints of `Value`s, and
More information about the Mlir-commits
mailing list