Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] Partial revert of d40eb0a #74755

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

sudonatalie
Copy link
Member

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.

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.
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 7, 2023

@llvm/pr-subscribers-backend-spir-v

Author: Natalie Chouinard (sudonatalie)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/74755.diff

1 Files Affected:

  • (modified) llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp (+3-1)
diff --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
index f04ab4e3ebfb9e..d450613196f3e4 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);

@sudonatalie sudonatalie merged commit 5ca1f2a into llvm:main Dec 7, 2023
4 of 6 checks passed
@sudonatalie sudonatalie deleted the text-fixes-3 branch December 7, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants