r274220 - AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.

Haustov, Nikolay via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 5 02:16:38 PDT 2016


It does because CC_OpenCLKernel case now uses CGM member.

Nikolay

________________________________________
From: Tom Stellard [tom at stellard.net]
Sent: Tuesday, July 05, 2016 3:47 AM
To: Haustov, Nikolay
Cc: cfe-commits at lists.llvm.org
Subject: Re: r274220 - AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.

On Thu, Jun 30, 2016 at 09:06:34AM -0000, Nikolay Haustov via cfe-commits wrote:
> Author: nhaustov
> Date: Thu Jun 30 04:06:33 2016
> New Revision: 274220
>
> URL: http://llvm.org/viewvc/llvm-project?rev=274220&view=rev
> Log:
> AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.

> -static unsigned ClangCallConvToLLVMCallConv(CallingConv CC) {
> +unsigned CodeGenTypes::ClangCallConvToLLVMCallConv(CallingConv CC) {

Was this change left over from a previous version of the patch?  This
patch doesn't seem to require that this be a member function.

-Tom

>    switch (CC) {
>    default: return llvm::CallingConv::C;
>    case CC_X86StdCall: return llvm::CallingConv::X86_StdCall;
> @@ -57,7 +58,7 @@ static unsigned ClangCallConvToLLVMCallC
>    // TODO: Add support for __vectorcall to LLVM.
>    case CC_X86VectorCall: return llvm::CallingConv::X86_VectorCall;
>    case CC_SpirFunction: return llvm::CallingConv::SPIR_FUNC;
> -  case CC_SpirKernel: return llvm::CallingConv::SPIR_KERNEL;
> +  case CC_OpenCLKernel: return CGM.getTargetCodeGenInfo().getOpenCLKernelCallingConv();
>    case CC_PreserveMost: return llvm::CallingConv::PreserveMost;
>    case CC_PreserveAll: return llvm::CallingConv::PreserveAll;
>    case CC_Swift: return llvm::CallingConv::Swift;


More information about the cfe-commits mailing list