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

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 12:22:59 PST 2023


Author: Natalie Chouinard
Date: 2023-12-07T15:22:54-05:00
New Revision: 5ca1f2aff7156dd61de5bcf8c5130b072cdca461

URL: https://github.com/llvm/llvm-project/commit/5ca1f2aff7156dd61de5bcf8c5130b072cdca461
DIFF: https://github.com/llvm/llvm-project/commit/5ca1f2aff7156dd61de5bcf8c5130b072cdca461.diff

LOG: [SPIR-V] Partial revert of d40eb0a (#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.

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Removed: 
    


################################################################################
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