LLVM  10.0.0svn
RISCVCallLowering.cpp
Go to the documentation of this file.
1 //===-- RISCVCallLowering.cpp - Call lowering -------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// This file implements the lowering of LLVM calls to machine code calls for
11 /// GlobalISel.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "RISCVCallLowering.h"
16 #include "RISCVISelLowering.h"
18 
19 using namespace llvm;
20 
22  : CallLowering(&TLI) {}
23 
25  const Value *Val,
26  ArrayRef<Register> VRegs) const {
27 
28  MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(RISCV::PseudoRET);
29 
30  if (Val != nullptr) {
31  return false;
32  }
33  MIRBuilder.insertInstr(Ret);
34  return true;
35 }
36 
38  MachineIRBuilder &MIRBuilder, const Function &F,
39  ArrayRef<ArrayRef<Register>> VRegs) const {
40 
41  if (F.arg_empty())
42  return true;
43 
44  return false;
45 }
46 
48  CallLoweringInfo &Info) const {
49  return false;
50 }
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs...
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
F(f)
bool arg_empty() const
Definition: Function.h:734
MachineInstrBuilder buildInstrNoInsert(unsigned Opcode)
Build but don&#39;t insert <empty> = Opcode <empty>.
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val, ArrayRef< Register > VRegs) const override
This hook behaves as the extended lowerReturn function, but for targets that do not support swifterro...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
Analysis containing CSE Info
Definition: CSEInfo.cpp:20
Helper class to build MachineInstr.
This file describes how to lower LLVM calls to machine code calls.
RISCVCallLowering(const RISCVTargetLowering &TLI)
This file declares the MachineIRBuilder class.
MachineInstrBuilder insertInstr(MachineInstrBuilder MIB)
Insert an existing instruction at the insertion point.
LLVM Value Representation.
Definition: Value.h:74