From: Nikolay Haustov Date: Fri, 6 May 2016 15:00:51 +0000 (+0000) Subject: Revert "AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d385c5143e097c37379960e90f255a8c0c1f95ed;p=clang Revert "AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels." This reverts commit f7053ec90d0fc56f0837e43c2c759e85b56c21a1. It broke calling OpenCL kernel from another kernel. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268740 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 4448057a37..4ee8573049 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -6826,14 +6826,6 @@ void AMDGPUTargetCodeGenInfo::setTargetAttributes( if (!FD) return; - if (M.getLangOpts().OpenCL) { - if (FD->hasAttr()) { - // Set amdgpu_kernel calling convention for OpenCL kernels. - llvm::Function *Fn = cast(GV); - Fn->setCallingConv(llvm::CallingConv::AMDGPU_KERNEL); - } - } - if (const auto Attr = FD->getAttr()) { llvm::Function *F = cast(GV); uint32_t NumVGPR = Attr->getNumVGPR(); diff --git a/test/CodeGenOpenCL/amdgpu-calling-conv.cl b/test/CodeGenOpenCL/amdgpu-calling-conv.cl deleted file mode 100644 index 7da9d7f4d4..0000000000 --- a/test/CodeGenOpenCL/amdgpu-calling-conv.cl +++ /dev/null @@ -1,12 +0,0 @@ -// REQUIRES: amdgpu-registered-target -// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck %s - -// CHECK: define amdgpu_kernel void @calling_conv_amdgpu_kernel() -kernel void calling_conv_amdgpu_kernel() -{ -} - -// CHECK: define void @calling_conv_none() -void calling_conv_none() -{ -} diff --git a/test/CodeGenOpenCL/amdgpu-num-gpr-attr.cl b/test/CodeGenOpenCL/amdgpu-num-gpr-attr.cl index 589d00d1ea..d2ecc7a8c6 100644 --- a/test/CodeGenOpenCL/amdgpu-num-gpr-attr.cl +++ b/test/CodeGenOpenCL/amdgpu-num-gpr-attr.cl @@ -5,23 +5,23 @@ __attribute__((amdgpu_num_vgpr(64))) // expected-no-diagnostics kernel void test_num_vgpr64() { -// CHECK: define amdgpu_kernel void @test_num_vgpr64() [[ATTR_VGPR64:#[0-9]+]] +// CHECK: define void @test_num_vgpr64() [[ATTR_VGPR64:#[0-9]+]] } __attribute__((amdgpu_num_sgpr(32))) // expected-no-diagnostics kernel void test_num_sgpr32() { -// CHECK: define amdgpu_kernel void @test_num_sgpr32() [[ATTR_SGPR32:#[0-9]+]] +// CHECK: define void @test_num_sgpr32() [[ATTR_SGPR32:#[0-9]+]] } __attribute__((amdgpu_num_vgpr(64), amdgpu_num_sgpr(32))) // expected-no-diagnostics kernel void test_num_vgpr64_sgpr32() { -// CHECK: define amdgpu_kernel void @test_num_vgpr64_sgpr32() [[ATTR_VGPR64_SGPR32:#[0-9]+]] +// CHECK: define void @test_num_vgpr64_sgpr32() [[ATTR_VGPR64_SGPR32:#[0-9]+]] } __attribute__((amdgpu_num_sgpr(20), amdgpu_num_vgpr(40))) // expected-no-diagnostics kernel void test_num_sgpr20_vgpr40() { -// CHECK: define amdgpu_kernel void @test_num_sgpr20_vgpr40() [[ATTR_SGPR20_VGPR40:#[0-9]+]] +// CHECK: define void @test_num_sgpr20_vgpr40() [[ATTR_SGPR20_VGPR40:#[0-9]+]] } __attribute__((amdgpu_num_vgpr(0))) // expected-no-diagnostics