[llvm] [IR] Remove deprecated PointerType methods that always return true (PR #74521)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 12:46:10 PST 2023


https://github.com/aeubanks created https://github.com/llvm/llvm-project/pull/74521

None

>From 71b8f204026a50becaacefa335c7271dfbaeb6a5 Mon Sep 17 00:00:00 2001
From: Arthur Eubanks <aeubanks at google.com>
Date: Tue, 5 Dec 2023 12:45:20 -0800
Subject: [PATCH] [IR] Remove deprecated PointerType methods that always return
 true

---
 llvm/include/llvm/IR/DerivedTypes.h           | 21 -------------------
 llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp |  3 +--
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index f7a09fda8ccb7..36ca157a1a3d1 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -680,9 +680,6 @@ class PointerType : public Type {
     return get(PT->getContext(), AddressSpace);
   }
 
-  [[deprecated("Always returns true")]]
-  bool isOpaque() const { return true; }
-
   /// Return true if the specified type is valid as a element type.
   static bool isValidElementType(Type *ElemTy);
 
@@ -692,24 +689,6 @@ class PointerType : public Type {
   /// Return the address space of the Pointer type.
   inline unsigned getAddressSpace() const { return getSubclassData(); }
 
-  /// Return true if either this is an opaque pointer type or if this pointee
-  /// type matches Ty. Primarily used for checking if an instruction's pointer
-  /// operands are valid types. Will be useless after non-opaque pointers are
-  /// removed.
-  [[deprecated("Always returns true")]]
-  bool isOpaqueOrPointeeTypeMatches(Type *) {
-    return true;
-  }
-
-  /// Return true if both pointer types have the same element type. Two opaque
-  /// pointers are considered to have the same element type, while an opaque
-  /// and a non-opaque pointer have different element types.
-  /// TODO: Remove after opaque pointer transition is complete.
-  [[deprecated("Always returns true")]]
-  bool hasSameElementTypeAs(PointerType *Other) {
-    return true;
-  }
-
   /// Implement support type inquiry through isa, cast, and dyn_cast.
   static bool classof(const Type *T) {
     return T->getTypeID() == PointerTyID;
diff --git a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
index 610d9a033aeea..000d68d4a79ff 100644
--- a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
@@ -506,8 +506,7 @@ bool SPIRVEmitIntrinsics::runOnFunction(Function &Func) {
       continue;
     Type *ElTy = SI->getValueOperand()->getType();
     PointerType *PTy = cast<PointerType>(SI->getOperand(1)->getType());
-    if (ElTy->isAggregateType() || ElTy->isVectorTy() ||
-        !PTy->isOpaqueOrPointeeTypeMatches(ElTy))
+    if (ElTy->isAggregateType() || ElTy->isVectorTy())
       AggrStores.insert(&I);
   }
 



More information about the llvm-commits mailing list