KhronosGroup/SPIRV-LLVM

SPIR-V generator doesn't generate OpGetDefaultQueue

Closed this issue · 1 comments

Reproducer:
set PATH_TO_GEN to spirv-1.0 generator install directory
And run (in bash)
${PATH_TO_GEN}/bin/clang -cc1 -x cl -cl-std=CL2.0 -triple spir64-unknonw-unknown -emit-spirv -include ${PATH_TO_GEN}/lib/clang/3.6.1/include/opencl-20.h repro.cl -o /tmp/out.spv && ./llvm-spirv -to-text /tmp/out.spv -o - | grep -i default

Expected:
GetDefaultQueue operation
Actual:
7 Name 4 "get_default_queue"
9 Decorate 4 LinkageAttributes "get_default_queue" Import

bader commented

It was the issue in the way this built-in is defined in the header file. It was not marked as overloadable, so LLVM/SPIR-V translator didn't recognize it as OpenCL built-in function. I added this attribute at KhronosGroup/SPIR@beccb14, although it doesn't make too much sense to make this built-in function overloadable - it has no parameters.