2016-04-15 03:09:28 +08:00
|
|
|
//===- lib/Target/AMDGPU/AMDGPUCallLowering.h - Call lowering -*- C++ -*---===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2016-04-15 03:09:28 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// This file describes how to lower LLVM calls to machine code calls.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUCALLLOWERING_H
|
|
|
|
|
2017-03-27 22:04:01 +08:00
|
|
|
#include "AMDGPU.h"
|
2016-04-15 03:09:28 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class AMDGPUTargetLowering;
|
2019-07-26 10:36:05 +08:00
|
|
|
class MachineInstrBuilder;
|
2016-04-15 03:09:28 +08:00
|
|
|
|
|
|
|
class AMDGPUCallLowering: public CallLowering {
|
AMDGPU/GlobalISel: Rename MIRBuilder to B. NFC
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67374
llvm-svn: 371467
2019-09-10 07:06:13 +08:00
|
|
|
Register lowerParameterPtr(MachineIRBuilder &B, Type *ParamTy,
|
2018-07-06 01:01:20 +08:00
|
|
|
uint64_t Offset) const;
|
Re-commit AMDGPU/GlobalISel: Add support for simple shaders
Fix build when global-isel is disabled and fix a warning.
Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.
Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm
Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D26730
llvm-svn: 293551
2017-01-31 05:56:46 +08:00
|
|
|
|
AMDGPU/GlobalISel: Rename MIRBuilder to B. NFC
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67374
llvm-svn: 371467
2019-09-10 07:06:13 +08:00
|
|
|
void lowerParameter(MachineIRBuilder &B, Type *ParamTy, uint64_t Offset,
|
|
|
|
unsigned Align, Register DstReg) const;
|
Re-commit AMDGPU/GlobalISel: Add support for simple shaders
Fix build when global-isel is disabled and fix a warning.
Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.
Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm
Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D26730
llvm-svn: 293551
2017-01-31 05:56:46 +08:00
|
|
|
|
2019-07-19 22:15:18 +08:00
|
|
|
/// A function of this type is used to perform value split action.
|
2019-07-19 22:29:30 +08:00
|
|
|
using SplitArgTy = std::function<void(ArrayRef<Register>, LLT, LLT, int)>;
|
2019-07-19 22:15:18 +08:00
|
|
|
|
|
|
|
void splitToValueTypes(const ArgInfo &OrigArgInfo,
|
|
|
|
SmallVectorImpl<ArgInfo> &SplitArgs,
|
|
|
|
const DataLayout &DL, MachineRegisterInfo &MRI,
|
|
|
|
CallingConv::ID CallConv,
|
|
|
|
SplitArgTy SplitArg) const;
|
|
|
|
|
AMDGPU/GlobalISel: Rename MIRBuilder to B. NFC
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67374
llvm-svn: 371467
2019-09-10 07:06:13 +08:00
|
|
|
bool lowerReturnVal(MachineIRBuilder &B, const Value *Val,
|
|
|
|
ArrayRef<Register> VRegs, MachineInstrBuilder &Ret) const;
|
2019-07-26 10:36:05 +08:00
|
|
|
|
2019-07-19 22:15:18 +08:00
|
|
|
public:
|
2016-04-15 03:09:28 +08:00
|
|
|
AMDGPUCallLowering(const AMDGPUTargetLowering &TLI);
|
|
|
|
|
AMDGPU/GlobalISel: Rename MIRBuilder to B. NFC
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67374
llvm-svn: 371467
2019-09-10 07:06:13 +08:00
|
|
|
bool lowerReturn(MachineIRBuilder &B, const Value *Val,
|
2019-06-24 23:50:29 +08:00
|
|
|
ArrayRef<Register> VRegs) const override;
|
2019-07-11 22:18:25 +08:00
|
|
|
|
AMDGPU/GlobalISel: Rename MIRBuilder to B. NFC
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67374
llvm-svn: 371467
2019-09-10 07:06:13 +08:00
|
|
|
bool lowerFormalArgumentsKernel(MachineIRBuilder &B, const Function &F,
|
2019-07-11 22:18:25 +08:00
|
|
|
ArrayRef<ArrayRef<Register>> VRegs) const;
|
|
|
|
|
AMDGPU/GlobalISel: Rename MIRBuilder to B. NFC
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67374
llvm-svn: 371467
2019-09-10 07:06:13 +08:00
|
|
|
bool lowerFormalArguments(MachineIRBuilder &B, const Function &F,
|
2019-06-27 16:54:17 +08:00
|
|
|
ArrayRef<ArrayRef<Register>> VRegs) const override;
|
2017-05-18 05:56:25 +08:00
|
|
|
static CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg);
|
|
|
|
static CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg);
|
2016-04-15 03:09:28 +08:00
|
|
|
};
|
|
|
|
} // End of namespace llvm;
|
|
|
|
#endif
|