mirror of
https://github.com/intel/llvm.git
synced 2026-02-04 03:26:06 +08:00
[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
This commit is contained in:
@@ -3627,6 +3627,9 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
|
||||
|
||||
MaybeHandleStaticInExternC(D, Fn);
|
||||
|
||||
if (D->hasAttr<CUDAGlobalAttr>())
|
||||
getTargetCodeGenInfo().setCUDAKernelCallingConvention(Fn);
|
||||
|
||||
maybeSetTrivialComdat(*D, *Fn);
|
||||
|
||||
CodeGenFunction(*this).GenerateCode(D, Fn, FI);
|
||||
|
||||
Reference in New Issue
Block a user