Skip to content

Commit b9b26c9

Browse files
authored
[SPIRV_LLVM_TRANSLATOR] add patch for addrspacecast of null (#11809)
Required after the codegen changes in JuliaLang/julia#58837 Upstream PR opened at SPIRV-LLVM-Translator#3305
1 parent 82a3452 commit b9b26c9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

S/SPIRV_LLVM_Translator/build_tarballs.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ llvm_version = v"20.1.2"
1414
sources = [
1515
GitSource(
1616
"https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git",
17-
"dee371987a59ed8654083c09c5f1d5c54f5db318")
17+
"dee371987a59ed8654083c09c5f1d5c54f5db318"),
18+
DirectorySource("./bundled"),
1819
]
1920

2021
# Bash recipe for building across all platforms
2122
get_script(llvm_version) = raw"""
2223
cd SPIRV-LLVM-Translator
24+
atomic_patch -p1 ../addrspacecast_null.patch
2325
install_license LICENSE.TXT
2426
2527
if [[ ("${target}" == x86_64-apple-darwin*) ]]; then
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp
2+
index d668ee89..4ae4f7ca 100644
3+
--- a/lib/SPIRV/SPIRVWriter.cpp
4+
+++ b/lib/SPIRV/SPIRVWriter.cpp
5+
@@ -1628,6 +1628,9 @@ SPIRVValue *LLVMToSPIRVBase::transUnaryInst(UnaryInstruction *U,
6+
} else {
7+
BOC = OpCrossWorkgroupCastToPtrINTEL;
8+
}
9+
+ } else if (isa<ConstantPointerNull>(Cast->getPointerOperand())) {
10+
+ SPIRVType *TransTy = transScavengedType(U);
11+
+ return BM->addNullConstant(bcast<SPIRVTypePointer>(TransTy));
12+
} else {
13+
getErrorLog().checkError(
14+
SrcAddrSpace == SPIRAS_Generic, SPIRVEC_InvalidModule, U,

0 commit comments

Comments
 (0)