[Mlir-commits] [mlir] de9f320 - [mlir][irdl] Add IsolatedFromAbove trait to irdl.operation, irdl.attribute and irdl.type (#181108)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Feb 13 09:06:56 PST 2026


Author: lonely eagle
Date: 2026-02-14T01:06:49+08:00
New Revision: de9f320a3399adc49a4bf844b5ad76b873b3accc

URL: https://github.com/llvm/llvm-project/commit/de9f320a3399adc49a4bf844b5ad76b873b3accc
DIFF: https://github.com/llvm/llvm-project/commit/de9f320a3399adc49a4bf844b5ad76b873b3accc.diff

LOG: [mlir][irdl] Add IsolatedFromAbove trait to irdl.operation, irdl.attribute and irdl.type (#181108)

https://github.com/llvm/llvm-project/pull/180556 depend it.Prevent CSE
from hoisting pure operations from the irdl.operation region into the
irdl.dialect region. You can see
https://github.com/llvm/llvm-project/pull/180556#issuecomment-3889133389.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
index 3b6b09973645c..688ec9855fa38 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
@@ -62,7 +62,7 @@ def IRDL_DialectOp : IRDL_Op<"dialect",
 
 def IRDL_TypeOp : IRDL_Op<"type",
     [HasParent<"DialectOp">, NoTerminator, NoRegionArguments,
-     AtMostOneChildOf<"ParametersOp">, Symbol]> {
+     AtMostOneChildOf<"ParametersOp">, Symbol, IsolatedFromAbove]> {
   let summary = "Define a new type";
   let description = [{
     `irdl.type` defines a new type belonging to the `irdl.dialect` parent.
@@ -96,7 +96,7 @@ def IRDL_TypeOp : IRDL_Op<"type",
 
 def IRDL_AttributeOp : IRDL_Op<"attribute",
     [HasParent<"DialectOp">, NoTerminator, NoRegionArguments,
-     AtMostOneChildOf<"ParametersOp">, Symbol]> {
+     AtMostOneChildOf<"ParametersOp">, Symbol, IsolatedFromAbove]> {
   let summary = "Define a new attribute";
   let description = [{
     `irdl.attribute` defines a new attribute belonging to the `irdl.dialect`
@@ -169,7 +169,7 @@ def IRDL_ParametersOp : IRDL_Op<"parameters",
 def IRDL_OperationOp : IRDL_Op<"operation",
     [HasParent<"DialectOp">, NoTerminator, NoRegionArguments,
     AtMostOneChildOf<"OperandsOp, ResultsOp, AttributesOp, RegionsOp">,
-    Symbol]> {
+    Symbol, IsolatedFromAbove]> {
   let summary = "Define a new operation";
   let description = [{
     `irdl.operation` defines a new operation belonging to the `irdl.dialect`


        


More information about the Mlir-commits mailing list