[Mlir-commits] [mlir] [MLIR][LLVM] Remove typed pointers from the LLVM dialect (PR #71285)

Markus Böck llvmlistbot at llvm.org
Sat Nov 4 11:10:01 PDT 2023


================
@@ -55,43 +55,17 @@ def LLVM_AnyFloat : Type<
 def LLVM_AnyPointer : Type<CPred<"::llvm::isa<::mlir::LLVM::LLVMPointerType>($_self)">,
                           "LLVM pointer type", "::mlir::LLVM::LLVMPointerType">;
 
-def LLVM_OpaquePointer : Type<
-  And<[LLVM_AnyPointer.predicate,
-       CPred<"::llvm::cast<::mlir::LLVM::LLVMPointerType>($_self).isOpaque()">]>,
-  "LLVM opaque pointer", "::mlir::LLVM::LLVMPointerType">;
-
-// Type constraint accepting LLVM pointer type with an additional constraint
-// on the element type.
-class LLVM_PointerTo<Type pointee> : Type<
-  And<[LLVM_AnyPointer.predicate,
-       Or<[LLVM_OpaquePointer.predicate,
-           SubstLeaves<
-             "$_self",
-             "::llvm::cast<::mlir::LLVM::LLVMPointerType>($_self).getElementType()",
-             pointee.predicate>]>]>,
-  "LLVM pointer to " # pointee.summary, "::mlir::LLVM::LLVMPointerType">;
-
 // Opaque pointer in a given address space.
 class LLVM_OpaquePointerInAddressSpace<int addressSpace> : Type<
-  And<[LLVM_OpaquePointer.predicate,
----------------
zero9178 wrote:

The predicate here must continue checking whether this is a `LLVMPointerType` prior to doing the `llvm::cast`. So this should probably be `And<[LLVM_AnyPointer.predicate, ` instead.
If its not too much effort I'd also remove the `Opaque` from the name given its not a useful distinction anymore. 

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


More information about the Mlir-commits mailing list