[llvm] r335829 - AMDGPU: Error on calls from graphics shaders
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 28 03:18:36 PDT 2018
Author: arsenm
Date: Thu Jun 28 03:18:36 2018
New Revision: 335829
URL: http://llvm.org/viewvc/llvm-project?rev=335829&view=rev
Log:
AMDGPU: Error on calls from graphics shaders
In principle nothing should stop these from working, but
work is necessary to create an ABI for dealing with the stack
related registers.
Modified:
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/trunk/test/CodeGen/AMDGPU/unsupported-calls.ll
Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=335829&r1=335828&r2=335829&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Thu Jun 28 03:18:36 2018
@@ -2310,6 +2310,13 @@ SDValue SITargetLowering::LowerCall(Call
"unsupported required tail call to function ");
}
+ if (AMDGPU::isShader(MF.getFunction().getCallingConv())) {
+ // Note the issue is with the CC of the calling function, not of the call
+ // itself.
+ return lowerUnhandledCall(CLI, InVals,
+ "unsupported call from graphics shader of function ");
+ }
+
// The first 4 bytes are reserved for the callee's emergency stack slot.
const unsigned CalleeUsableStackOffset = 4;
Modified: llvm/trunk/test/CodeGen/AMDGPU/unsupported-calls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/unsupported-calls.ll?rev=335829&r1=335828&r2=335829&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/unsupported-calls.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/unsupported-calls.ll Thu Jun 28 03:18:36 2018
@@ -67,3 +67,10 @@ define void @test_indirect_call(void()*
call void %fptr()
ret void
}
+
+; GCN: :0:0: in function test_call_from_shader i32 (): unsupported call from graphics shader of function defined_function
+; R600: in function test_call{{.*}}: unsupported call to function defined_function
+define amdgpu_ps i32 @test_call_from_shader() {
+ %call = call i32 @defined_function(i32 0)
+ ret i32 %call
+}
More information about the llvm-commits
mailing list