diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp index a57be060..26f6aea4 100644 --- a/lib/SPIRV/SPIRVWriter.cpp +++ b/lib/SPIRV/SPIRVWriter.cpp @@ -756,9 +756,10 @@ SPIRVType *LLVMToSPIRVBase::transPointerType(SPIRVType *ET, unsigned AddrSpc) { !BM->shouldEmitFunctionPtrAddrSpace()) return transPointerType(ET, SPIRAS_Private); if (BM->isAllowedToUseExtension(ExtensionID::SPV_KHR_untyped_pointers) && - !(ET->isTypeArray() || ET->isTypeVector() || ET->isSPIRVOpaqueType() || + !(ET->isTypeArray() || ET->isTypeVector() || ET->isTypeStruct() || + ET->isSPIRVOpaqueType() || (M->getTargetTriple() == "spirv64-amd-amdhsa" && - ET->getOpCode() == OpTypeFunction))) { + ET->getOpCode() == OpTypeFunction))) { TranslatedTy = BM->addUntypedPointerKHRType( SPIRSPIRVAddrSpaceMap::map(static_cast(AddrSpc))); } else {