From 79ec3080a25804be09c3016a4806cca501c676a9 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Wed, 26 May 2021 18:50:19 +0200 Subject: [PATCH] [AMDGPU][GlobalISel] Allow amdgpu_gfx calling conv Calling functions from shaders already works with the SelectionDAG. Differential Revision: https://reviews.llvm.org/D103183 --- lib/Target/AMDGPU/AMDGPUCallLowering.cpp | 8 +------- test/CodeGen/AMDGPU/pal-simple-indirect-call.ll | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Target/AMDGPU/AMDGPUCallLowering.cpp b/lib/Target/AMDGPU/AMDGPUCallLowering.cpp index 0c9af9ac581..2a229affeb1 100644 --- a/lib/Target/AMDGPU/AMDGPUCallLowering.cpp +++ b/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/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll b/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll index 277fc9c2d86..e5f0a1d1220 100644 --- a/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll +++ b/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"