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

1

2

3

4

5

6

7

8

19

20using namespace llvm;

21

24 cl::desc("Always use $gp as the global base register."));

25

29 &Src2DstMBB) const {

31}

32

34

36 return GlobalBaseReg;

37}

38

42

43 if (STI.inMips16Mode())

44 return Mips::CPU16RegsRegClass;

45

46 if (STI.inMicroMipsMode())

47 return Mips::GPRMM16RegClass;

48

50 return Mips::GPR64RegClass;

51

52 return Mips::GPR32RegClass;

53}

54

56 if (!GlobalBaseReg)

57 GlobalBaseReg =

59 return GlobalBaseReg;

60}

61

63 if (!GlobalBaseReg) {

66 }

67 return GlobalBaseReg;

68}

69

71 if (!GlobalBaseReg)

72 return;

73

82 RC = (ABI.IsN64()) ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;

83

84 Register V0 = RegInfo.createVirtualRegister(RC);

85 Register V1 = RegInfo.createVirtualRegister(RC);

86

87 if (ABI.IsN64()) {

89 MBB.addLiveIn(Mips::T9_64);

90

91

92

93

101 return;

102 }

103

105

106

107

108

113 return;

114 }

115

117 MBB.addLiveIn(Mips::T9);

118

119 if (ABI.IsN32()) {

120

121

122

129 return;

130 }

131

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

152 MBB.addLiveIn(Mips::V0);

155}

156

159 for (int &I : EhDataRegFI) {

162 ? Mips::GPR64RegClass

163 : Mips::GPR32RegClass;

164

166 TRI.getSpillAlign(RC), false);

167 }

168}

169

171

172

173

174

177

178 for (int &I : ISRDataRegFI)

180 TRI.getSpillAlign(RC), false);

181}

182

184 return CallsEhReturn && (FI == EhDataRegFI[0] || FI == EhDataRegFI[1]

185 || FI == EhDataRegFI[2] || FI == EhDataRegFI[3]);

186}

187

189 return IsISR && (FI == ISRDataRegFI[0] || FI == ISRDataRegFI[1]);

190}

192 const char *ES) {

194}

195

200

204 if (MoveF64ViaSpillFI == -1) {

206 TRI.getSpillSize(*RC), TRI.getSpillAlign(*RC), false);

207 }

208 return MoveF64ViaSpillFI;

209}

210

211void MipsFunctionInfo::anchor() {}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

const TargetInstrInfo & TII

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

Register const TargetRegisterInfo * TRI

static cl::opt< bool > FixGlobalBaseReg("mips-fix-global-base-reg", cl::Hidden, cl::init(true), cl::desc("Always use $gp as the global base register."))

static const TargetRegisterClass & getGlobalBaseRegClass(MachineFunction &MF)

Definition MipsMachineFunction.cpp:39

MachineInstrBundleIterator< MachineInstr > iterator

LLVM_ABI int CreateStackObject(uint64_t Size, Align Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)

Create a new statically sized stack object, returning a nonnegative identifier to represent it.

PseudoSourceValueManager & getPSVManager() const

const TargetSubtargetInfo & getSubtarget() const

getSubtarget - Return the subtarget for which this machine code is being compiled.

MachineFrameInfo & getFrameInfo()

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

MachineRegisterInfo & getRegInfo()

getRegInfo - Return information about the registers currently in use.

Function & getFunction()

Return the LLVM function that this machine code represents.

Ty * cloneInfo(const Ty &Old)

const MachineBasicBlock & front() const

const TargetMachine & getTarget() const

getTarget - Return the target machine this machine code is compiled with

const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned TargetFlags=0) const

const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const

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

Add a new virtual register operand.

MachineRegisterInfo - Keep track of information for virtual and physical registers,...

LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")

createVirtualRegister - Create and return a new virtual register in the function with the specified r...

void addLiveIn(MCRegister Reg, Register vreg=Register())

addLiveIn - Add the specified register as a live-in.

Register getGlobalBaseRegForGlobalISel(MachineFunction &MF)

Definition MipsMachineFunction.cpp:62

bool isISRRegFI(int FI) const

Definition MipsMachineFunction.cpp:188

MachinePointerInfo callPtrInfo(MachineFunction &MF, const char *ES)

Create a MachinePointerInfo that has an ExternalSymbolPseudoSourceValue object representing a GOT ent...

Definition MipsMachineFunction.cpp:191

int getMoveF64ViaSpillFI(MachineFunction &MF, const TargetRegisterClass *RC)

Definition MipsMachineFunction.cpp:201

Register getGlobalBaseReg(MachineFunction &MF)

Definition MipsMachineFunction.cpp:55

MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override

Make a functionally equivalent copy of this MachineFunctionInfo in MF.

Definition MipsMachineFunction.cpp:27

MipsFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)

bool globalBaseRegSet() const

Definition MipsMachineFunction.cpp:35

bool isEhDataRegFI(int FI) const

Definition MipsMachineFunction.cpp:183

void createEhDataRegsFI(MachineFunction &MF)

Definition MipsMachineFunction.cpp:157

void initGlobalBaseReg(MachineFunction &MF)

Definition MipsMachineFunction.cpp:70

~MipsFunctionInfo() override

void createISRRegFI(MachineFunction &MF)

Definition MipsMachineFunction.cpp:170

const MipsABIInfo & getABI() const

const MipsABIInfo & getABI() const

LLVM_ABI const PseudoSourceValue * getExternalSymbolCallEntry(const char *ES)

LLVM_ABI const PseudoSourceValue * getGlobalValueCallEntry(const GlobalValue *GV)

Wrapper class representing virtual and physical registers.

TargetInstrInfo - Interface to description of machine instruction set.

bool isPositionIndependent() const

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

virtual const TargetInstrInfo * getInstrInfo() const

virtual const TargetRegisterInfo * getRegisterInfo() const =0

Return the target's register information.

initializer< Ty > init(const Ty &Val)

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.

BumpPtrAllocatorImpl<> BumpPtrAllocator

The standard BumpPtrAllocator which just uses the default template parameters.

MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...

This class contains a discriminated union of information about pointers in memory operands,...