[llvm] r312936 - AMDGPU: Allow coldcc calls
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 11:54:21 PDT 2017
Author: arsenm
Date: Mon Sep 11 11:54:20 2017
New Revision: 312936
URL: http://llvm.org/viewvc/llvm-project?rev=312936&view=rev
Log:
AMDGPU: Allow coldcc calls
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp?rev=312936&r1=312935&r2=312936&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Mon Sep 11 11:54:20 2017
@@ -851,6 +851,7 @@ CCAssignFn *AMDGPUCallLowering::CCAssign
return CC_AMDGPU;
case CallingConv::C:
case CallingConv::Fast:
+ case CallingConv::Cold:
return CC_AMDGPU_Func;
default:
report_fatal_error("Unsupported calling convention.");
@@ -871,6 +872,7 @@ CCAssignFn *AMDGPUCallLowering::CCAssign
return RetCC_SI_Shader;
case CallingConv::C:
case CallingConv::Fast:
+ case CallingConv::Cold:
return RetCC_AMDGPU_Func;
default:
report_fatal_error("Unsupported calling convention.");
Modified: llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll?rev=312936&r1=312935&r2=312936&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll Mon Sep 11 11:54:20 2017
@@ -43,3 +43,37 @@ define amdgpu_ps half @ps_ret_cc_inreg_f
%add = fadd half %arg0, 1.0
ret half %add
}
+
+; GCN-LABEL: {{^}}fastcc:
+; GCN: v_add_f32_e32 v0, 4.0, v0
+define fastcc float @fastcc(float %arg0) #0 {
+ %add = fadd float %arg0, 4.0
+ ret float %add
+}
+
+; GCN-LABEL: {{^}}coldcc:
+; GCN: v_add_f32_e32 v0, 4.0, v0
+define coldcc float @coldcc(float %arg0) #0 {
+ %add = fadd float %arg0, 4.0
+ ret float %add
+}
+
+; GCN-LABEL: {{^}}call_coldcc:
+; GCN: v_mov_b32_e32 v0, 1.0
+; GCN: s_swappc_b64
+define amdgpu_kernel void @call_coldcc() #0 {
+ %val = call float @coldcc(float 1.0)
+ store float %val, float addrspace(1)* undef
+ ret void
+}
+
+; GCN-LABEL: {{^}}call_fastcc:
+; GCN: v_mov_b32_e32 v0, 1.0
+; GCN: s_swappc_b64
+define amdgpu_kernel void @call_fastcc() #0 {
+ %val = call float @fastcc(float 1.0)
+ store float %val, float addrspace(1)* undef
+ ret void
+}
+
+attributes #0 = { nounwind noinline }
\ No newline at end of file
More information about the llvm-commits
mailing list