Skip to content

Commit de9f320

Browse files
[mlir][irdl] Add IsolatedFromAbove trait to irdl.operation, irdl.attribute and irdl.type (#181108)
llvm/llvm-project#180556 depend it.Prevent CSE from hoisting pure operations from the irdl.operation region into the irdl.dialect region. You can see llvm/llvm-project#180556 (comment).
1 parent b217e5c commit de9f320

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def IRDL_DialectOp : IRDL_Op<"dialect",
6262

6363
def IRDL_TypeOp : IRDL_Op<"type",
6464
[HasParent<"DialectOp">, NoTerminator, NoRegionArguments,
65-
AtMostOneChildOf<"ParametersOp">, Symbol]> {
65+
AtMostOneChildOf<"ParametersOp">, Symbol, IsolatedFromAbove]> {
6666
let summary = "Define a new type";
6767
let description = [{
6868
`irdl.type` defines a new type belonging to the `irdl.dialect` parent.
@@ -96,7 +96,7 @@ def IRDL_TypeOp : IRDL_Op<"type",
9696

9797
def IRDL_AttributeOp : IRDL_Op<"attribute",
9898
[HasParent<"DialectOp">, NoTerminator, NoRegionArguments,
99-
AtMostOneChildOf<"ParametersOp">, Symbol]> {
99+
AtMostOneChildOf<"ParametersOp">, Symbol, IsolatedFromAbove]> {
100100
let summary = "Define a new attribute";
101101
let description = [{
102102
`irdl.attribute` defines a new attribute belonging to the `irdl.dialect`
@@ -169,7 +169,7 @@ def IRDL_ParametersOp : IRDL_Op<"parameters",
169169
def IRDL_OperationOp : IRDL_Op<"operation",
170170
[HasParent<"DialectOp">, NoTerminator, NoRegionArguments,
171171
AtMostOneChildOf<"OperandsOp, ResultsOp, AttributesOp, RegionsOp">,
172-
Symbol]> {
172+
Symbol, IsolatedFromAbove]> {
173173
let summary = "Define a new operation";
174174
let description = [{
175175
`irdl.operation` defines a new operation belonging to the `irdl.dialect`

0 commit comments

Comments
 (0)