[llvm] [SPIR-V] Partial revert of d40eb0a (PR #74755)

Natalie Chouinard via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 12:20:39 PST 2023


https://github.com/sudonatalie created https://github.com/llvm/llvm-project/pull/74755

This part of the #74660 patch was incorrect and shouldn't have been changed since this usage of `isOpaque()` is not one of `PointerType`'s functions.

>From 23bf975ac433fde7dee03040966b4cf64e232d99 Mon Sep 17 00:00:00 2001
From: Natalie Chouinard <chouinard at google.com>
Date: Thu, 7 Dec 2023 20:06:22 +0000
Subject: [PATCH] [SPIR-V] Partial revert of d40eb0a

This part of the patch was incorrect and shouldn't have been changed
since this usage of `isOpaque()` is not one of PointerType's functions.
---
 llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
index f04ab4e3ebfb9..d450613196f3e 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
@@ -690,7 +690,9 @@ SPIRVType *SPIRVGlobalRegistry::createSPIRVType(
     return getOpTypeArray(Ty->getArrayNumElements(), El, MIRBuilder, EmitIR);
   }
   if (auto SType = dyn_cast<StructType>(Ty)) {
-    return getOpTypeOpaque(SType, MIRBuilder);
+    if (SType->isOpaque())
+      return getOpTypeOpaque(SType, MIRBuilder);
+    return getOpTypeStruct(SType, MIRBuilder, EmitIR);
   }
   if (auto FType = dyn_cast<FunctionType>(Ty)) {
     SPIRVType *RetTy = findSPIRVType(FType->getReturnType(), MIRBuilder);



More information about the llvm-commits mailing list