From: Sebastian Neubauer Date: Wed, 26 May 2021 16:50:19 +0000 (+0200) Subject: [AMDGPU][GlobalISel] Allow amdgpu_gfx calling conv X-Git-Tag: llvmorg-14-init~5467 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bb60dbe34e4a934e47a0493832f3384fb09b7db;p=platform%2Fupstream%2Fllvm.git [AMDGPU][GlobalISel] Allow amdgpu_gfx calling conv Calling functions from shaders already works with the SelectionDAG. Differential Revision: https://reviews.llvm.org/D103183 --- diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp index 0c9af9a..2a229af 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp @@ -1252,19 +1252,13 @@ bool AMDGPUCallLowering::lowerCall(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI = MF.getRegInfo(); const SITargetLowering &TLI = *getTLI(); 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 OutArgs; for (auto &OrigArg : Info.OrigArgs) splitToValueTypes(OrigArg, OutArgs, DL, Info.CallConv); diff --git a/llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll b/llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll index 277fc9c..e5f0a1d 100644 --- a/llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll +++ b/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"