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] Remove deleted functions #74660

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

sudonatalie
Copy link
Member

Remove references to functions that were deleted in #74521 which are causing SPIR-V backend build failures.

Remove references to functions that were removed in llvm#74521 causing
SPIR-V backend build failures.
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 6, 2023

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

Author: Natalie Chouinard (sudonatalie)

Changes

Remove references to functions that were deleted in #74521 which are causing SPIR-V backend build failures.


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

2 Files Affected:

  • (modified) llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp (+2-9)
  • (modified) llvm/lib/Target/SPIRV/SPIRVUtils.cpp (+3-4)
diff --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
index 0e3fcf4701e622..f04ab4e3ebfb9e 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
@@ -690,9 +690,7 @@ SPIRVType *SPIRVGlobalRegistry::createSPIRVType(
     return getOpTypeArray(Ty->getArrayNumElements(), El, MIRBuilder, EmitIR);
   }
   if (auto SType = dyn_cast<StructType>(Ty)) {
-    if (SType->isOpaque())
-      return getOpTypeOpaque(SType, MIRBuilder);
-    return getOpTypeStruct(SType, MIRBuilder, EmitIR);
+    return getOpTypeOpaque(SType, MIRBuilder);
   }
   if (auto FType = dyn_cast<FunctionType>(Ty)) {
     SPIRVType *RetTy = findSPIRVType(FType->getReturnType(), MIRBuilder);
@@ -707,12 +705,7 @@ SPIRVType *SPIRVGlobalRegistry::createSPIRVType(
     // At the moment, all opaque pointers correspond to i8 element type.
     // TODO: change the implementation once opaque pointers are supported
     // in the SPIR-V specification.
-    if (PType->isOpaque())
-      SpvElementType = getOrCreateSPIRVIntegerType(8, MIRBuilder);
-    else
-      SpvElementType =
-          findSPIRVType(PType->getNonOpaquePointerElementType(), MIRBuilder,
-                        SPIRV::AccessQualifier::ReadWrite, EmitIR);
+    SpvElementType = getOrCreateSPIRVIntegerType(8, MIRBuilder);
     auto SC = addressSpaceToStorageClass(PType->getAddressSpace());
     // Null pointer means we have a loop in type definitions, make and
     // return corresponding OpTypeForwardPointer.
diff --git a/llvm/lib/Target/SPIRV/SPIRVUtils.cpp b/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
index 6cb51d782919d5..0bd51436082d5f 100644
--- a/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVUtils.cpp
@@ -326,10 +326,9 @@ std::string getOclOrSpirvBuiltinDemangledName(StringRef Name) {
 }
 
 const Type *getTypedPtrEltType(const Type *Ty) {
-  auto PType = dyn_cast<PointerType>(Ty);
-  if (!PType || PType->isOpaque())
-    return Ty;
-  return PType->getNonOpaquePointerElementType();
+  // TODO: This function requires updating following the opaque pointer
+  // migration.
+  return Ty;
 }
 
 bool hasBuiltinTypePrefix(StringRef Name) {

Copy link
Contributor

@bogner bogner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's NFC and fixes the build. LGTM

@sudonatalie sudonatalie merged commit d40eb0a into llvm:main Dec 7, 2023
4 of 5 checks passed
@sudonatalie sudonatalie deleted the broken-tree branch December 7, 2023 14:37
sudonatalie added a commit that referenced this pull request Dec 7, 2023
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.
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

4 participants