LLVM: lib/Target/M68k/M68kSubtarget.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

18

23

30

31using namespace llvm;

32

33#define DEBUG_TYPE "m68k-subtarget"

34

35#define GET_SUBTARGETINFO_TARGET_DESC

36#define GET_SUBTARGETINFO_CTOR

37#include "M68kGenSubtargetInfo.inc"

38

40

41

43 if (CPU.empty() || CPU == "generic") {

44 CPU = "M68000";

45 }

46 return CPU;

47}

48

49void M68kSubtarget::anchor() {}

50

54 InstrInfo(initializeSubtargetDependencies(CPU, TT, FS, TM)),

55 FrameLowering(*this, this->getStackAlignment()), TLInfo(TM, *this),

56 TargetTriple(TT) {

59

63}

64

67}

68

71}

72

75}

76

79}

80

83}

84

86

90

91

93

94

95 InstrItins = getInstrItineraryForCPU(CPUName);

96

98

99 return *this;

100}

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

164 default:

170 }

174 } else {

176 }

177 }

178 }

179}

180

181unsigned char

184 default:

189 }

192

195 }

196

197

199 } else {

202 }

204 }

205 }

209 } else {

211 }

212 }

213 }

214}

215

219

222

224}

225

226unsigned char

229}

230

232 const Module &M) const {

235

237 default:

244 }

248

251

253 }

257

259 }

260 }

261}

262

265

266

267

268

272

274 }

275

276

278}

279

280unsigned char

283}

284

285unsigned char

287 const Module &M) const {

288

291

292

293

294

295 auto *F = dyn_cast_or_null(GV);

296 if (F && F->hasFnAttribute(Attribute::NonLazyBind)) {

298 }

299

300

302}

This file contains the simple types necessary to represent the attributes associated with functions a...

This file implements the lowering of LLVM calls to machine code calls for GlobalISel.

This file declares the targeting of the MachineLegalizer class for M68k.

This file declares the M68k specific subclass of MachineFunctionInfo.

This file declares the targeting of the RegisterBankInfo class for M68k.

This file contains the M68k implementation of the TargetRegisterInfo class.

static StringRef selectM68kCPU(Triple TT, StringRef CPU)

Select the M68k CPU for the given triple and cpu name.

This file declares the M68k specific subclass of TargetSubtargetInfo.

This file declares the M68k specific subclass of TargetMachine.

This file contains the entry points for global functions defined in the M68k target library,...

Module * getParent()

Get the module that this global value is contained inside of...

This class provides the information for the target register banks.

unsigned char classifyExternalReference(const Module &M) const

Classify a external variable reference for the current subtarget according to how we should reference...

InstrItineraryData InstrItins

const M68kTargetLowering * getTargetLowering() const override

M68kSubtarget(const Triple &TT, StringRef CPU, StringRef FS, const M68kTargetMachine &_TM)

This constructor initializes the data members to match that of the specified triple.

unsigned char classifyBlockAddressReference() const

Classify a blockaddress reference for the current subtarget according to how we should reference it i...

const LegalizerInfo * getLegalizerInfo() const override

const RegisterBankInfo * getRegBankInfo() const override

bool isLegalToCallImmediateAddr() const

Return true if the subtarget allows calls to immediate address.

std::unique_ptr< CallLowering > CallLoweringInfo

void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)

Parses features string setting specified subtarget options.

const M68kTargetMachine & TM

unsigned char classifyGlobalReference(const GlobalValue *GV, const Module &M) const

Classify a global variable reference for the current subtarget according to how we should reference i...

const CallLowering * getCallLowering() const override

unsigned getJumpTableEncoding() const

InstructionSelector * getInstructionSelector() const override

std::unique_ptr< RegisterBankInfo > RegBankInfo

unsigned char classifyLocalReference(const GlobalValue *GV) const

Classify a global variable reference for the current subtarget according to how we should reference i...

unsigned stackAlignment

The minimum alignment known to hold of the stack frame on entry to the function and which must be mai...

const M68kRegisterInfo * getRegisterInfo() const override

bool atLeastM68020() const

bool isPositionIndependent() const

M68kSubtarget & initializeSubtargetDependencies(StringRef CPU, Triple TT, StringRef FS, const M68kTargetMachine &TM)

unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const Module &M) const

Classify a global function reference for the current subtarget.

std::unique_ptr< InstructionSelector > InstSelector

@ EK_LabelDifference32

EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table.

@ EK_Custom32

EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJ...

@ EK_BlockAddress

EK_BlockAddress - Each entry is a plain address of block, e.g.: .word LBB123.

A Module instance is used to store all the information related to an LLVM module.

Holds all the information related to register banks.

StringRef - Represent a constant reference to a string, i.e.

std::string str() const

str - Get the contents as an std::string.

constexpr bool empty() const

empty - Check if the string is empty.

bool isPositionIndependent() const

bool shouldAssumeDSOLocal(const GlobalValue *GV) const

CodeModel::Model getCodeModel() const

Returns the code model.

Triple - Helper class for working with autoconf configuration names.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

@ MO_GOTOFF

On a symbol operand this indicates that the immediate is the offset to the location of the symbol nam...

@ MO_PLT

On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol name from ...

@ MO_GOT

On a symbol operand this indicates that the immediate is the offset to the GOT entry for the symbol n...

@ MO_ABSOLUTE_ADDRESS

On a symbol operand this indicates that the immediate is the absolute address of the symbol.

@ MO_GOTPCREL

On a symbol operand this indicates that the immediate is offset to the GOT entry for the symbol name ...

@ MO_PC_RELATIVE_ADDRESS

On a symbol operand this indicates that the immediate is the pc-relative address of the symbol.

This is an optimization pass for GlobalISel generic memory operations.

InstructionSelector * createM68kInstructionSelector(const M68kTargetMachine &TM, const M68kSubtarget &Subtarget, const M68kRegisterBankInfo &RBI)