Skip to content

[IR] Remove deprecated PointerType methods that always return true #74521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

aeubanks
Copy link
Contributor

@aeubanks aeubanks commented Dec 5, 2023

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Dec 5, 2023

@llvm/pr-subscribers-llvm-ir

@llvm/pr-subscribers-backend-spir-v

Author: Arthur Eubanks (aeubanks)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/74521.diff

2 Files Affected:

  • (modified) llvm/include/llvm/IR/DerivedTypes.h (-21)
  • (modified) llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp (+1-2)
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);
   }
 

@nikic
Copy link
Contributor

nikic commented Dec 5, 2023

Any reason not to drop all the deprecated typed pointer methods at once?

@aeubanks
Copy link
Contributor Author

aeubanks commented Dec 5, 2023

so the commit message can contain migration instructions (yes the migration instructions are also on the declarations but this makes it just a bit easier for people who just want to look at the commit message)

@aeubanks aeubanks merged commit 651a49c into llvm:main Dec 5, 2023
@aeubanks aeubanks deleted the pointer branch December 5, 2023 23:09
sudonatalie added a commit to sudonatalie/llvm-project that referenced this pull request Dec 6, 2023
Remove references to functions that were removed in llvm#74521 causing
SPIR-V backend build failures.
sudonatalie added a commit that referenced this pull request Dec 7, 2023
Remove references to functions that were deleted in #74521 which are
causing SPIR-V backend build failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants