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

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 15:09:40 PST 2023


Author: Arthur Eubanks
Date: 2023-12-05T15:09:36-08:00
New Revision: 651a49c4b6bdef81c8deddbe653258c066867a58

URL: https://github.com/llvm/llvm-project/commit/651a49c4b6bdef81c8deddbe653258c066867a58
DIFF: https://github.com/llvm/llvm-project/commit/651a49c4b6bdef81c8deddbe653258c066867a58.diff

LOG: [IR] Remove deprecated PointerType methods that always return true (#74521)

Added: 
    

Modified: 
    llvm/include/llvm/IR/DerivedTypes.h
    llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Removed: 
    


################################################################################
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 
diff erent 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