[mlir][irdl] Add IsolatedFromAbove trait to irdl.operation, irdl.attribute and irdl.type#181108
Conversation
|
@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:
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`
|
math-fehr
left a comment
There was a problem hiding this comment.
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.❤️ |
|
Since there are no other reviewers available, I've gone ahead and merged it. |
#180556 depend it.Prevent CSE from hoisting pure operations from the irdl.operation region into the irdl.dialect region. You can see #180556 (comment).