From: Sidorov, Dmitry Date: Tue, 8 Nov 2022 09:43:49 +0000 (-0800) Subject: [PATCH 04/79] [NFC] Replace getPointerElementType in SPIRVRegularizeLLVM X-Git-Tag: archive/raspbian/15.0.1-1+rpi1^2^2~81 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b719235fa7960956f8236bec9390e341734cd1f0;p=spirv-llvm-translator-15.git [PATCH 04/79] [NFC] Replace getPointerElementType in SPIRVRegularizeLLVM Signed-off-by: Sidorov, Dmitry Gbp-Pq: Name 0004-NFC-Replace-getPointerElementType-in-SPIRVRegularize.patch --- diff --git a/lib/SPIRV/SPIRVRegularizeLLVM.cpp b/lib/SPIRV/SPIRVRegularizeLLVM.cpp index 3300aab..d0e3ae1 100644 --- a/lib/SPIRV/SPIRVRegularizeLLVM.cpp +++ b/lib/SPIRV/SPIRVRegularizeLLVM.cpp @@ -371,12 +371,13 @@ void SPIRVRegularizeLLVMBase::adaptStructTypes(StructType *ST) { // register by OpCompositeConstruct. And we can't claim, that the Result type // of OpCompositeConstruct instruction is always the joint matrix type, it's // simply not true. - if (MangledName == "__spirv_JointMatrixINTEL") { + if (MangledName == "__spirv_JointMatrixINTEL" && !ST->isOpaquePointerTy()) { auto *PtrTy = dyn_cast(ST->getElementType(0)); assert(PtrTy && "Expected a pointer to an array to represent joint matrix type"); std::vector TypeLayout; - ArrayType *ArrayTy = dyn_cast(PtrTy->getPointerElementType()); + ArrayType *ArrayTy = + dyn_cast(PtrTy->getNonOpaquePointerElementType()); assert(ArrayTy && "Expected a pointer element type of an array type to " "represent joint matrix type"); TypeLayout.push_back(ArrayTy->getNumElements());