[OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN target
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 19 Jul 2016 19:39:45 +0000 (19:39 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 19 Jul 2016 19:39:45 +0000 (19:39 +0000)
commitf2e8ab25666b2300a228997d6cbac54bff30fc44
tree5d0205b47f33844ade2cb20319e955d8ad9f8492
parent633d749da70924c774e1c4357e02d0e65cf95f3a
[OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN target

Added the opencl.ocl.version metadata to be emitted with amdgcn. Created a static function emitOCLVerMD which is shared between triple spir and target amdgcn.

Also added new testcases to existing test file, spir_version.cl inside test/CodeGenOpenCL.

Patch by Aaron En Ye Shi.

Differential Revision: https://reviews.llvm.org/D22424

llvm-svn: 276010
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGenOpenCL/spir_version.cl