LLVM: lib/Target/Mips/Mips16FrameLowering.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

29#include

30#include

31

32using namespace llvm;

33

36

43

44

45

47

49

50

51 if (StackSize == 0 && !MFI.adjustsStack()) return;

52

53

54 TII.makeFrame(Mips::SP, StackSize, MBB, MBBI);

55

58

60

61 if (!CSI.empty()) {

64 }

65

69}

70

79

80 if (!StackSize)

81 return;

82

86

87

88

89 TII.restoreFrame(Mips::SP, StackSize, MBB, MBBI);

90}

91

96

97

98

99

100

101

103

104

105

106

107

109 bool IsRAAndRetAddrIsTaken = (Reg == Mips::RA)

111 if (!IsRAAndRetAddrIsTaken)

112 MBB.addLiveIn(Reg);

113 }

114

115 return true;

116}

117

121

122

123

124

125

126

127

128 return true;

129}

130

131bool

138

147 bool SaveS2 = Reserved[Mips::S2];

148 if (SaveS2)

149 SavedRegs.set(Mips::S2);

151 SavedRegs.set(Mips::S0);

152}

153

const TargetInstrInfo & TII

MachineBasicBlock MachineBasicBlock::iterator MBBI

This file implements the BitVector class.

Register const TargetRegisterInfo * TRI

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

Helper class for creating CFI instructions and inserting them into MIR.

void buildDefCFAOffset(int64_t Offset, MCSymbol *Label=nullptr) const

void buildOffset(MCRegister Reg, int64_t Offset) const

The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...

Wrapper class representing physical registers. Should be passed by value.

MachineInstrBundleIterator< MachineInstr > iterator

The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.

bool hasVarSizedObjects() const

This method may be called any time after instruction selection is complete to determine if the stack ...

uint64_t getStackSize() const

Return the number of bytes that must be allocated to hold all of the fixed size frame objects.

bool adjustsStack() const

Return true if this function adjusts the stack – e.g., when calling another function.

bool isReturnAddressTaken() const

This method may be called any time after instruction selection is complete to determine if there is a...

uint64_t getMaxCallFrameSize() const

Return the maximum size of a call frame that must be allocated for an outgoing function call.

const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const

Returns a reference to call saved info vector for the current function.

int64_t getObjectOffset(int ObjectIdx) const

Return the assigned stack offset of the specified object from the incoming stack pointer.

MachineFrameInfo & getFrameInfo()

getFrameInfo - Return the frame info object for the current function.

const MachineInstrBuilder & setMIFlag(MachineInstr::MIFlag Flag) const

const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const

Add a new virtual register operand.

void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override

This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...

Definition Mips16FrameLowering.cpp:139

void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override

Definition Mips16FrameLowering.cpp:71

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...

Definition Mips16FrameLowering.cpp:92

bool hasReservedCallFrame(const MachineFunction &MF) const override

hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required,...

Definition Mips16FrameLowering.cpp:132

Mips16FrameLowering(const MipsSubtarget &STI)

Definition Mips16FrameLowering.cpp:34

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...

Definition Mips16FrameLowering.cpp:118

void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override

emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.

Definition Mips16FrameLowering.cpp:37

MipsFrameLowering(const MipsSubtarget &sti, Align Alignment)

const MipsSubtarget & STI

BitVector getReservedRegs(const MachineFunction &MF) const override

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...

unsigned getStackAlignment() const

getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...

bool hasFP(const MachineFunction &MF) const

hasFP - Return true if the specified function should have a dedicated frame pointer register.

virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const

This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...

TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...

This is an optimization pass for GlobalISel generic memory operations.

MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)

Builder interface. Specify how to create the initial instruction itself.

constexpr bool isInt(int64_t x)

Checks if an integer fits into the given bit width.

const MipsFrameLowering * createMips16FrameLowering(const MipsSubtarget &ST)

Create MipsFrameLowering objects.

Definition Mips16FrameLowering.cpp:155