Skip to content

Commit be215e7

Browse files
[SPIR-V] Remove calls to deprecated PointerType methods (1/2) (#68336)
1 parent d51855f commit be215e7

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,6 @@ SPIRVType *SPIRVGlobalRegistry::getOpTypeStruct(const StructType *Ty,
594594
SPIRVType *SPIRVGlobalRegistry::getOrCreateSpecialType(
595595
const Type *Ty, MachineIRBuilder &MIRBuilder,
596596
SPIRV::AccessQualifier::AccessQualifier AccQual) {
597-
// Some OpenCL and SPIRV builtins like image2d_t are passed in as
598-
// pointers, but should be treated as custom types like OpTypeImage.
599-
if (auto PType = dyn_cast<PointerType>(Ty)) {
600-
assert(!PType->isOpaque());
601-
Ty = PType->getNonOpaquePointerElementType();
602-
}
603597
assert(isSpecialOpaqueType(Ty) && "Not a special opaque builtin type");
604598
return SPIRV::lowerBuiltinType(Ty, AccQual, MIRBuilder, this);
605599
}
@@ -755,13 +749,10 @@ SPIRVType *SPIRVGlobalRegistry::restOfCreateSPIRVType(
755749
!isSpecialOpaqueType(Ty)) {
756750
if (!Ty->isPointerTy())
757751
DT.add(Ty, &MIRBuilder.getMF(), getSPIRVTypeID(SpirvType));
758-
else if (Ty->isOpaquePointerTy())
752+
else
759753
DT.add(Type::getInt8Ty(MIRBuilder.getMF().getFunction().getContext()),
760754
Ty->getPointerAddressSpace(), &MIRBuilder.getMF(),
761755
getSPIRVTypeID(SpirvType));
762-
else
763-
DT.add(Ty->getNonOpaquePointerElementType(), Ty->getPointerAddressSpace(),
764-
&MIRBuilder.getMF(), getSPIRVTypeID(SpirvType));
765756
}
766757

767758
return SpirvType;

0 commit comments

Comments
 (0)