[PATCH] D48645: AMDGPU: Error on calls from graphics shaders

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 06:41:46 PDT 2018


arsenm created this revision.
arsenm added reviewers: msearles, rampitec, nhaehnle.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, wdng, kzhuravl.

In principle nothing should stop these from working, but
work is necessary to create an ABI for dealing with the stack
related registers.


https://reviews.llvm.org/D48645

Files:
  lib/Target/AMDGPU/SIISelLowering.cpp
  test/CodeGen/AMDGPU/unsupported-calls.ll


Index: test/CodeGen/AMDGPU/unsupported-calls.ll
===================================================================
--- test/CodeGen/AMDGPU/unsupported-calls.ll
+++ test/CodeGen/AMDGPU/unsupported-calls.ll
@@ -67,3 +67,10 @@
   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
+}
Index: lib/Target/AMDGPU/SIISelLowering.cpp
===================================================================
--- lib/Target/AMDGPU/SIISelLowering.cpp
+++ lib/Target/AMDGPU/SIISelLowering.cpp
@@ -2350,6 +2350,13 @@
                               "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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48645.153073.patch
Type: text/x-patch
Size: 1302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180627/ddff8d1c/attachment.bin>


More information about the llvm-commits mailing list