LLVM 24.0.0git
AVRFrameLowering.h
Go to the documentation of this file.
1//===-- AVRFrameLowering.h - Define frame lowering for AVR ------*- 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#ifndef LLVM_AVR_FRAME_LOWERING_H
10#define LLVM_AVR_FRAME_LOWERING_H
11
13
14namespace llvm {
15
16/// Utilities for creating function call frames.
18public:
19 explicit AVRFrameLowering();
20
21public:
22 void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
23 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
24
26 Register &FrameReg) const override;
27
31 const TargetRegisterInfo *TRI) const override;
32 bool
36 const TargetRegisterInfo *TRI) const override;
37 bool hasReservedCallFrame(const MachineFunction &MF) const override;
38 bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override;
40 RegScavenger *RS = nullptr) const override;
43 MachineBasicBlock::iterator MI) const override;
44
45protected:
46 bool hasFPImpl(const MachineFunction &MF) const override;
47};
48
49} // end namespace llvm
50
51#endif // LLVM_AVR_FRAME_LOWERING_H
MachineBasicBlock & MBB
IRTranslator LLVM IR MI
Register const TargetRegisterInfo * TRI
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
bool hasReservedCallFrame(const MachineFunction &MF) const override
hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required,...
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, MutableArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override
canSimplifyCallFramePseudos - When possible, it's best to simplify the call frame pseudo ops before d...
StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const override
getFrameIndexReference - This method should return the base register and offset used to reference a f...
bool hasFPImpl(const MachineFunction &MF) const override
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, ArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
MachineInstrBundleIterator< MachineInstr > iterator
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:294
Wrapper class representing virtual and physical registers.
Definition Register.h:20
StackOffset holds a fixed and a scalable offset in bytes.
Definition TypeSize.h:30
TargetFrameLowering(StackDirection D, Align StackAl, int LAO, Align TransAl=Align(1), bool StackReal=true)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.