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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions llvm/include/llvm/IR/DerivedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down