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
|
|
|
|
2020-07-26 22:52:51 +08:00
|
|
|
class AMDGPUCallLowering final : public CallLowering {
|
2020-05-07 22:47:25 +08:00
|
|
|
void lowerParameterPtr(Register DstReg, MachineIRBuilder &B, Type *ParamTy,
|
|
|
|
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,
|
2020-03-31 15:52:49 +08:00
|
|
|
Align Alignment, 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.
|
2020-02-22 23:00:38 +08:00
|
|
|
using SplitArgTy = std::function<void(ArrayRef<Register>, Register, LLT, LLT, int)>;
|
2019-07-19 22:15:18 +08:00
|
|
|
|
2020-02-22 23:00:38 +08:00
|
|
|
void splitToValueTypes(MachineIRBuilder &B,
|
|
|
|
const ArgInfo &OrigArgInfo,
|
2019-07-19 22:15:18 +08:00
|
|
|
SmallVectorImpl<ArgInfo> &SplitArgs,
|
2020-02-22 23:00:38 +08:00
|
|
|
const DataLayout &DL,
|
2019-07-19 22:15:18 +08:00
|
|
|
CallingConv::ID CallConv,
|
2020-07-04 02:47:23 +08:00
|
|
|
bool IsOutgoing,
|
2019-07-19 22:15:18 +08:00
|
|
|
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;
|
2020-07-04 02:47:23 +08:00
|
|
|
|
|
|
|
bool passSpecialInputs(MachineIRBuilder &MIRBuilder,
|
|
|
|
CCState &CCInfo,
|
|
|
|
SmallVectorImpl<std::pair<MCRegister, Register>> &ArgRegs,
|
|
|
|
CallLoweringInfo &Info) const;
|
|
|
|
|
|
|
|
bool lowerCall(MachineIRBuilder &MIRBuilder,
|
|
|
|
CallLoweringInfo &Info) 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
|