diff options
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 7 | ||||
-rw-r--r-- | llvm/test/CodeGen/AMDGPU/unsupported-calls.ll | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index 2936e1759e6..9481e2cbf4e 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -2310,6 +2310,13 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI, "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; diff --git a/llvm/test/CodeGen/AMDGPU/unsupported-calls.ll b/llvm/test/CodeGen/AMDGPU/unsupported-calls.ll index 68872c54f7f..434ba0327e7 100644 --- a/llvm/test/CodeGen/AMDGPU/unsupported-calls.ll +++ b/llvm/test/CodeGen/AMDGPU/unsupported-calls.ll @@ -67,3 +67,10 @@ define void @test_indirect_call(void()* %fptr) { 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 +} |