LLVM  13.0.0git
PPCCallLowering.cpp
Go to the documentation of this file.
1 //===-- PPCCallLowering.h - Call lowering for GlobalISel -------*- 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 "PPCCallLowering.h"
17 #include "llvm/Support/Debug.h"
18 
19 #define DEBUG_TYPE "ppc-call-lowering"
20 
21 using namespace llvm;
22 
24  : CallLowering(&TLI) {}
25 
27  const Value *Val, ArrayRef<Register> VRegs,
29  Register SwiftErrorVReg) const {
30  assert(((Val && !VRegs.empty()) || (!Val && VRegs.empty())) &&
31  "Return value without a vreg");
32  if (VRegs.size() > 0)
33  return false;
34 
35  MIRBuilder.buildInstr(PPC::BLR8);
36  return true;
37 }
38 
40  const Function &F,
42  FunctionLoweringInfo &FLI) const {
43 
44  // If VRegs is empty, then there are no formal arguments to lower and thus can
45  // always return true. If there are formal arguments, we currently do not
46  // handle them and thus return false.
47  return VRegs.empty();
48 }
49 
51  CallLoweringInfo &Info) const {
52  return false;
53 }
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
PPCCallLowering.h
llvm::Function
Definition: Function.h:61
llvm::PPCCallLowering::lowerCall
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
Definition: PPCCallLowering.cpp:50
MachineIRBuilder.h
llvm::ArrayRef::empty
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:158
F
#define F(x, y, z)
Definition: MD5.cpp:56
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:26
llvm::MachineIRBuilder
Helper class to build MachineInstr.
Definition: MachineIRBuilder.h:220
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::FunctionLoweringInfo
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Definition: FunctionLoweringInfo.h:53
llvm::PPCTargetLowering
Definition: PPCISelLowering.h:667
llvm::MachineIRBuilder::buildInstr
MachineInstrBuilder buildInstr(unsigned Opcode)
Build and insert <empty> = Opcode <empty>.
Definition: MachineIRBuilder.h:375
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::PPCCallLowering::PPCCallLowering
PPCCallLowering(const PPCTargetLowering &TLI)
Definition: PPCCallLowering.cpp:23
llvm::PPCCallLowering::lowerReturn
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, FunctionLoweringInfo &FLI, Register SwiftErrorVReg) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
Definition: PPCCallLowering.cpp:26
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::PPCCallLowering::lowerFormalArguments
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs, FunctionLoweringInfo &FLI) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs,...
Definition: PPCCallLowering.cpp:39
llvm::CallLowering::CallLoweringInfo
Definition: CallLowering.h:82
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:163
llvm::CallLowering
Definition: CallLowering.h:42
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
Debug.h