1 //===-- RISCVCallLowering.cpp - Call lowering -------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// This file implements the lowering of LLVM calls to machine code calls for
13 //===----------------------------------------------------------------------===//
15 #include "RISCVCallLowering.h"
16 #include "RISCVISelLowering.h"
17 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
21 RISCVCallLowering::RISCVCallLowering(const RISCVTargetLowering
&TLI
)
22 : CallLowering(&TLI
) {}
24 bool RISCVCallLowering::lowerReturn(MachineIRBuilder
&MIRBuilder
,
26 ArrayRef
<Register
> VRegs
) const {
28 MachineInstrBuilder Ret
= MIRBuilder
.buildInstrNoInsert(RISCV::PseudoRET
);
33 MIRBuilder
.insertInstr(Ret
);
37 bool RISCVCallLowering::lowerFormalArguments(
38 MachineIRBuilder
&MIRBuilder
, const Function
&F
,
39 ArrayRef
<ArrayRef
<Register
>> VRegs
) const {
47 bool RISCVCallLowering::lowerCall(MachineIRBuilder
&MIRBuilder
,
48 CallLoweringInfo
&Info
) const {