[llvm] [SPIR-V] Remove deleted functions (PR #74660)
Natalie Chouinard via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 14:06:07 PST 2023
https://github.com/sudonatalie created https://github.com/llvm/llvm-project/pull/74660
Remove references to functions that were deleted in #74521 which are causing SPIR-V backend build failures.
>From cab10899e25ca52cd391f788e878cf3e14abda47 Mon Sep 17 00:00:00 2001
From: Natalie Chouinard <chouinard at google.com>
Date: Wed, 6 Dec 2023 22:02:05 +0000
Subject: [PATCH] [SPIR-V] Remove deleted functions
Remove references to functions that were removed in #74521 causing
SPIR-V backend build failures.
---
llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp | 11 ++---------
llvm/lib/Target/SPIRV/SPIRVUtils.cpp | 7 +++----
2 files changed, 5 insertions(+), 13 deletions(-)
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) {
More information about the llvm-commits
mailing list