From b719235fa7960956f8236bec9390e341734cd1f0 Mon Sep 17 00:00:00 2001 From: "Sidorov, Dmitry" Date: Tue, 8 Nov 2022 01:43:49 -0800 Subject: [PATCH] [PATCH 04/79] [NFC] Replace getPointerElementType in SPIRVRegularizeLLVM Signed-off-by: Sidorov, Dmitry Gbp-Pq: Name 0004-NFC-Replace-getPointerElementType-in-SPIRVRegularize.patch --- lib/SPIRV/SPIRVRegularizeLLVM.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()); -- 2.30.2