[CUDA] Set LLVM calling convention for CUDA kernel
authorYaxun Liu <Yaxun.Liu@amd.com>
Fri, 20 Apr 2018 17:01:03 +0000 (17:01 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Fri, 20 Apr 2018 17:01:03 +0000 (17:01 +0000)
commit4306f2086fe838591f2d1fe041ef73b643aa99ee
treeddedd75da98d4b292b315f7fdfc818077d9b5f9c
parente268304122d827396979c61251f2862148ad01c8
[CUDA] Set LLVM calling convention for CUDA kernel

Some targets need special LLVM calling convention for CUDA kernel.
This patch does that through a TargetCodeGenInfo hook.

It only affects amdgcn target.

Patch by Greg Rodgers.
Revised and lit tests added by Yaxun Liu.

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

llvm-svn: 330447
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/CodeGen/TargetInfo.h
clang/test/CodeGenCUDA/kernel-amdgcn.cu [new file with mode: 0644]