[Mlir-commits] [mlir] [mlir][core|ptr] Add `PtrLikeTypeInterface` and casting ops to the `ptr` dialect (PR #137469)

Mehdi Amini llvmlistbot at llvm.org
Sun Apr 27 03:54:23 PDT 2025


================
@@ -63,6 +64,54 @@ def Ptr_PtrType : Ptr_Type<"Ptr", "ptr", [
       return $_get(memorySpace.getContext(), memorySpace);
     }]>
   ];
+  let extraClassDeclaration = [{
+    // `PtrLikeTypeInterface` interface methods.
+    /// Returns `Type()` as this pointer type is opaque.
+    Type getElementType() const {
+      return Type();
+    }
+    /// Clones the pointer with specified memory space or returns failure
+    /// if an `elementType` was specified or if the memory space doesn't
----------------
joker-eph wrote:

This is confusing, what's the point of providing `elementType` if it always triggers a failure?

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


More information about the Mlir-commits mailing list