[Mlir-commits] [mlir] [mlir][IR] Support op interfaces in `HasParent` trait (PR #91471)

Markus Böck llvmlistbot at llvm.org
Wed May 8 08:15:29 PDT 2024


================
@@ -1309,6 +1311,25 @@ struct HasParent {
       return llvm::cast<ParentOpType>(parent);
     }
   };
+
+private:
+  /// A class is an op interface if it has a `getInterfaceName` function.
----------------
zero9178 wrote:

We actually have logic for this already at https://github.com/llvm/llvm-project/blob/50b45b24220ead33cf5cedc49c13e0336297e4eb/mlir/include/mlir/Support/InterfaceSupport.h#L270 which is used to make `DenseMap` work with interfaces: https://github.com/llvm/llvm-project/blob/50b45b24220ead33cf5cedc49c13e0336297e4eb/mlir/include/mlir/IR/OpDefinition.h#L2130

https://github.com/llvm/llvm-project/pull/91471


More information about the Mlir-commits mailing list