Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version.
Details
Diff Detail
Event Timeline
I was just wondering with SPIRV coming these days, how long should we be supporting and maintaining previous SPIR versions. Might be worth clarifying that...
lib/CodeGen/TargetInfo.cpp | ||
---|---|---|
7044 | Could we please separate this from XCore code? Add separate anonymous namespace for it and proper heading comment. See XCore above as an example. |
Pls revise by Anastasia's comments. Otherwise LGTM.
We have two options about SPIR-V support:
- drop SPIR support and move on to SPIR-V
- keep supporting both SPIR and SPIR-V
Option 1 is cleaner and easier to maintain, however it will require changes in backends which expect SPIR format for OCL programs.
I think this is just a small change to help identify the which standard llvm-ir is using.
And there is a SPIRV branch from Khronos
https://github.com/KhronosGroup/SPIRV-LLVM
We can start there and try to merge the spir-v support into the llvm.org trunk.
test/CodeGenOpenCL/spir_version.cl | ||
---|---|---|
16 | The metadate will be merged into the same one, so there will be only one 2.0 here. |
test/CodeGenOpenCL/spir_version.cl | ||
---|---|---|
16 | Can you test 'spir64' too? |
Could we please separate this from XCore code?
Add separate anonymous namespace for it and proper heading comment. See XCore above as an example.