[PATCH] D103183: [AMDGPU][GlobalISel] Allow amdgpu_gfx calling conv

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 09:54:44 PDT 2021


sebastian-ne created this revision.
sebastian-ne added reviewers: arsenm, foad.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, rovka, yaxunl, nhaehnle, jvesely, kzhuravl.
sebastian-ne requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Calling functions from shaders already works with the SelectionDAG.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103183

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
  llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll


Index: llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll
+++ llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll
@@ -5,6 +5,7 @@
 ; Check that it doesn't crash
 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10 %s
+; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1010 -global-isel < %s | FileCheck -check-prefixes=GFX10 %s
 
 target datalayout = "A5"
 
Index: llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
@@ -1252,19 +1252,13 @@
   MachineRegisterInfo &MRI = MF.getRegInfo();
   const SITargetLowering &TLI = *getTLI<SITargetLowering>();
   const DataLayout &DL = F.getParent()->getDataLayout();
-  CallingConv::ID CallConv = F.getCallingConv();
 
   if (!AMDGPUTargetMachine::EnableFixedFunctionABI &&
-      CallConv != CallingConv::AMDGPU_Gfx) {
+      Info.CallConv != CallingConv::AMDGPU_Gfx) {
     LLVM_DEBUG(dbgs() << "Variable function ABI not implemented\n");
     return false;
   }
 
-  if (AMDGPU::isShader(CallConv)) {
-    LLVM_DEBUG(dbgs() << "Unhandled call from graphics shader\n");
-    return false;
-  }
-
   SmallVector<ArgInfo, 8> OutArgs;
   for (auto &OrigArg : Info.OrigArgs)
     splitToValueTypes(OrigArg, OutArgs, DL, Info.CallConv);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103183.348007.patch
Type: text/x-patch
Size: 1594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210526/9257a85c/attachment.bin>


More information about the llvm-commits mailing list