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

1

2

3

4

5

6

7

8

9

10

11

12

13

29

30using namespace llvm;

31

32#define DEBUG_TYPE "m68k-subtarget"

33

34#define GET_SUBTARGETINFO_TARGET_DESC

35#define GET_SUBTARGETINFO_CTOR

36#include "M68kGenSubtargetInfo.inc"

37

39

40

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

43 CPU = "M68000";

44 }

45 return CPU;

46}

47

48void M68kSubtarget::anchor() {}

49

56 TSInfo = std::make_unique();

57

60

64}

65

67

71

75

79

83

87

89 return TM.isPositionIndependent();

90}

91

93

97

98

100

101

102 InstrItins = getInstrItineraryForCPU(CPUName);

103

105

106 return *this;

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

162

163

164

165

166

167

168

170 switch (TM.getCodeModel()) {

171 default:

177 }

181 } else {

183 }

184 }

185 }

186}

187

188unsigned char

190 switch (TM.getCodeModel()) {

191 default:

196 }

199

202 }

203

204

206 } else {

209 }

211 }

212 }

216 } else {

218 }

219 }

220 }

221}

222

224 if (TM.shouldAssumeDSOLocal(nullptr))

226

229

231}

232

233unsigned char

237

239 const Module &M) const {

240 if (TM.shouldAssumeDSOLocal(GV))

242

243 switch (TM.getCodeModel()) {

244 default:

251 }

255

258

260 }

264

266 }

267 }

268}

269

272

273

274

275

279

281 }

282

283

285}

286

287unsigned char

291

292unsigned char

294 const Module &M) const {

295

296 if (TM.shouldAssumeDSOLocal(GV))

298

299

300

301

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

305 }

306

307

309}

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.

Definition M68kSubtarget.cpp:41

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.

Align getStackAlignment() const

TODO this must be controlled by options like -malign-int and -mshort.

unsigned char classifyExternalReference(const Module &M) const

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

Definition M68kSubtarget.cpp:223

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.

Definition M68kSubtarget.cpp:50

unsigned char classifyBlockAddressReference() const

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

Definition M68kSubtarget.cpp:169

const LegalizerInfo * getLegalizerInfo() const override

Definition M68kSubtarget.cpp:80

std::unique_ptr< const SelectionDAGTargetInfo > TSInfo

const RegisterBankInfo * getRegBankInfo() const override

Definition M68kSubtarget.cpp:84

bool isLegalToCallImmediateAddr() const

Return true if the subtarget allows calls to immediate address.

Definition M68kSubtarget.cpp:92

std::unique_ptr< CallLowering > CallLoweringInfo

const SelectionDAGTargetInfo * getSelectionDAGInfo() const override

Definition M68kSubtarget.cpp:68

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

Parses features string setting specified subtarget options.

const M68kTargetMachine & TM

M68kTargetLowering TLInfo

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

Definition M68kSubtarget.cpp:238

const CallLowering * getCallLowering() const override

Definition M68kSubtarget.cpp:72

unsigned getJumpTableEncoding() const

Definition M68kSubtarget.cpp:270

InstructionSelector * getInstructionSelector() const override

Definition M68kSubtarget.cpp:76

~M68kSubtarget() 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...

Definition M68kSubtarget.cpp:189

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

std::unique_ptr< LegalizerInfo > Legalizer

bool atLeastM68020() const

bool isPositionIndependent() const

Definition M68kSubtarget.cpp:88

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

Definition M68kSubtarget.cpp:94

M68kFrameLowering FrameLowering

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

Classify a global function reference for the current subtarget.

Definition M68kSubtarget.cpp:293

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.

Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...

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

std::string str() const

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

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.

auto dyn_cast_or_null(const Y &Val)

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