SPIR1.2 is defined using LLVM 3.2, and SPIR2.0 is defined using LLVM3.4. And, SPIR is also one of the possible output for SYCL device compiler (and SPIR is chosen in real production computecpp from codeplay) .
But latest LLVM/clang (for example version 3.9) is not compatible with LLVM 3.2/3.4, mainly in two parts:
-
some metadata is changed from module level to function level in llvm 3.9.
for example, the kernel function flag. If spir is pared with llvm/clang 3.9, no kernel function could be found. -
mangle is changed (fixed to be correct for Itanium ABI) in llvm3.9. see r262414 - Mangle extended qualifiers in the proper order and mangle the.
with this change, the function name/parameters in spir could not be demangled correctly with llvm3.9.
In open source community, it is nature to follow the new version of llvm/clang, but it conflicts with spir. Do we have any plan to discuss/resolve it? thanks.