@@ -594,12 +594,6 @@ SPIRVType *SPIRVGlobalRegistry::getOpTypeStruct(const StructType *Ty,
594
594
SPIRVType *SPIRVGlobalRegistry::getOrCreateSpecialType (
595
595
const Type *Ty, MachineIRBuilder &MIRBuilder,
596
596
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
- }
603
597
assert (isSpecialOpaqueType (Ty) && " Not a special opaque builtin type" );
604
598
return SPIRV::lowerBuiltinType (Ty, AccQual, MIRBuilder, this );
605
599
}
@@ -755,13 +749,10 @@ SPIRVType *SPIRVGlobalRegistry::restOfCreateSPIRVType(
755
749
!isSpecialOpaqueType (Ty)) {
756
750
if (!Ty->isPointerTy ())
757
751
DT.add (Ty, &MIRBuilder.getMF (), getSPIRVTypeID (SpirvType));
758
- else if (Ty-> isOpaquePointerTy ())
752
+ else
759
753
DT.add (Type::getInt8Ty (MIRBuilder.getMF ().getFunction ().getContext ()),
760
754
Ty->getPointerAddressSpace (), &MIRBuilder.getMF (),
761
755
getSPIRVTypeID (SpirvType));
762
- else
763
- DT.add (Ty->getNonOpaquePointerElementType (), Ty->getPointerAddressSpace (),
764
- &MIRBuilder.getMF (), getSPIRVTypeID (SpirvType));
765
756
}
766
757
767
758
return SpirvType;
0 commit comments