Skip to content

Commit 9dd1049

Browse files
authored
change mangling of pointers (#395)
This follows the mangling scheme as described in https://www.khronos.org/files/opencl-spir-12-provisional.pdf The Khronos translator seems to like this mangling better, see KhronosGroup/SPIRV-LLVM-Translator#3404
1 parent d6c49fb commit 9dd1049

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

lib/intrinsics/src/utils.jl

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,7 @@ macro builtin_ccall(name, ret, argtypes, args...)
3434
"d"
3535
elseif T <: LLVMPtr
3636
elt, as = T.parameters
37-
38-
# mangle address space
39-
ASstr = if as == AS.CrossWorkgroup
40-
"CLglobal"
41-
#elseif as == AS.Global_device
42-
# "CLdevice"
43-
#elseif as == AS.Global_host
44-
# "CLhost"
45-
elseif as == AS.Workgroup
46-
"CLlocal"
47-
elseif as == AS.UniformConstant
48-
"CLconstant"
49-
elseif as == AS.Function
50-
"CLprivate"
51-
elseif as == AS.Generic
52-
"CLgeneric"
53-
else
54-
error("Unknown address space $as")
55-
end
56-
57-
# encode as vendor qualifier
58-
ASstr = "U" * string(length(ASstr)) * ASstr
59-
60-
# XXX: where does the V come from?
61-
"P" * ASstr * "V" * mangle(elt)
37+
(as == AS.Private ? "P" : "PU3AS$as") * "V" * mangle(elt)
6238
else
6339
error("Unknown type $T")
6440
end

0 commit comments

Comments
 (0)