Skip to content

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

Merged
linuxlonelyeagle merged 2 commits into
llvm:mainfrom
linuxlonelyeagle:add-IsolatedFromAbove-to-irdl-operation
Feb 13, 2026
Merged

[mlir][irdl] Add IsolatedFromAbove trait to irdl.operation, irdl.attribute and irdl.type#181108
linuxlonelyeagle merged 2 commits into
llvm:mainfrom
linuxlonelyeagle:add-IsolatedFromAbove-to-irdl-operation

Conversation

@linuxlonelyeagle
Copy link
Copy Markdown
Member

@linuxlonelyeagle linuxlonelyeagle commented Feb 12, 2026

#180556 depend it.Prevent CSE from hoisting pure operations from the irdl.operation region into the irdl.dialect region. You can see #180556 (comment).

@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Feb 12, 2026

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-irdl

Author: lonely eagle (linuxlonelyeagle)

Changes

#180556 depend it.


Full diff: https://github.com/llvm/llvm-project/pull/181108.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td (+1-1)
diff --git a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
index 3b6b09973645c..de5d0d18e52bc 100644
--- a/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
+++ b/mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
@@ -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`

Copy link
Copy Markdown
Contributor

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense to me!
Especially since IRDL constraints expect either an operation, attribute, or type as a parent, that means that in any case you couldn't use anything from outside an operation at the moment!

I guess we should do the same thing for irdl.attribute and irdl.type though?

@linuxlonelyeagle
Copy link
Copy Markdown
Member Author

Yes, that makes sense to me! Especially since IRDL constraints expect either an operation, attribute, or type as a parent, that means that in any case you couldn't use anything from outside an operation at the moment!

I guess we should do the same thing for irdl.attribute and irdl.type though?

Thank you very much for your guidance and for taking the time to review my code.❤️

@linuxlonelyeagle linuxlonelyeagle changed the title [mlir][irdl] Add IsolatedFromAbove trait to irdl.operation op [mlir][irdl] Add IsolatedFromAbove trait to irdl.operation, irdl.attribute and irdl.type Feb 13, 2026
@linuxlonelyeagle linuxlonelyeagle merged commit de9f320 into llvm:main Feb 13, 2026
10 checks passed
@linuxlonelyeagle
Copy link
Copy Markdown
Member Author

Since there are no other reviewers available, I've gone ahead and merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants