[llvm] [IR] Remove deprecated PointerType methods that always return true (PR #74521)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 5 12:46:37 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-spir-v
Author: Arthur Eubanks (aeubanks)
<details>
<summary>Changes</summary>
---
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
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);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/74521
More information about the llvm-commits
mailing list