[PATCH 04/79] [NFC] Replace getPointerElementType in SPIRVRegularizeLLVM
authorSidorov, Dmitry <dmitry.sidorov@intel.com>
Tue, 8 Nov 2022 09:43:49 +0000 (01:43 -0800)
committerAndreas Beckmann <anbe@debian.org>
Thu, 8 Feb 2024 21:48:18 +0000 (22:48 +0100)
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
Gbp-Pq: Name 0004-NFC-Replace-getPointerElementType-in-SPIRVRegularize.patch

lib/SPIRV/SPIRVRegularizeLLVM.cpp

index 3300aab1af25b19f9debe3e8d6ad23e97bb40ca5..d0e3ae1ec289f9483e428abc6ef9d429fe95c683 100644 (file)
@@ -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<PointerType>(ST->getElementType(0));
     assert(PtrTy &&
            "Expected a pointer to an array to represent joint matrix type");
     std::vector<size_t> TypeLayout;
-    ArrayType *ArrayTy = dyn_cast<ArrayType>(PtrTy->getPointerElementType());
+    ArrayType *ArrayTy =
+        dyn_cast<ArrayType>(PtrTy->getNonOpaquePointerElementType());
     assert(ArrayTy && "Expected a pointer element type of an array type to "
                       "represent joint matrix type");
     TypeLayout.push_back(ArrayTy->getNumElements());