LLVM: include/llvm/CodeGen/MIRParser/MIParser.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CODEGEN_MIRPARSER_MIPARSER_H
14#define LLVM_CODEGEN_MIRPARSER_MIPARSER_H
15
23#include
24#include
25
26namespace llvm {
27
38
50
53
55private:
57
58
60
61
63
64
66
67
69
70
72
73
75
76
78
79
81
82
84
85
87
88 void initNames2InstrOpCodes();
89 void initNames2Regs();
90 void initNames2RegMasks();
91 void initNames2SubRegIndices();
92 void initNames2TargetIndices();
93 void initNames2DirectTargetFlags();
94 void initNames2BitmaskTargetFlags();
95 void initNames2MMOTargetFlags();
96
97 void initNames2RegClasses();
98 void initNames2RegBanks();
99
100public:
101
102
104
105
106
108
109
110
111
113
114
115
116
118
119
120
121
123
124
125
126
127
129
130
131
132
133
135
136
137
138
139
141
142
143
144
146
147
148
149
151
153
155 : Subtarget(STI) {
156 initNames2RegClasses();
157 initNames2RegBanks();
158 }
159
161
163};
164
171
174
182
183
185
189
193};
194
195
196
197
198
199
200
201
202
203
204
205
206
209
210
211
212
213
214
215
216
217
218
219
222
226
230
233
237
240
243
246
247}
248
249#endif
This file defines the StringMap class.
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Analysis containing CSE Info
This file defines the DenseMap class.
Lightweight error class with error context and mandatory checking.
Flags
Flags values. These may be or'd together.
This class implements the register bank concept.
Wrapper class representing virtual and physical registers.
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
Represents a range in source code.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
TargetSubtargetInfo - Generic base class for all target subtargets.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
bool parseStackObjectReference(PerFunctionMIParsingState &PFS, int &FI, StringRef Src, SMDiagnostic &Error)
bool parseMDNode(PerFunctionMIParsingState &PFS, MDNode *&Node, StringRef Src, SMDiagnostic &Error)
bool parseMachineBasicBlockDefinitions(PerFunctionMIParsingState &PFS, StringRef Src, SMDiagnostic &Error)
Parse the machine basic block definitions, and skip the machine instructions.
bool parseMBBReference(PerFunctionMIParsingState &PFS, MachineBasicBlock *&MBB, StringRef Src, SMDiagnostic &Error)
StringMap< const TargetRegisterClass * > Name2RegClassMap
Definition MIParser.h:51
StringMap< const RegisterBank * > Name2RegBankMap
Definition MIParser.h:52
bool parseMachineInstructions(PerFunctionMIParsingState &PFS, StringRef Src, SMDiagnostic &Error)
Parse the machine instructions.
bool parseRegisterReference(PerFunctionMIParsingState &PFS, Register &Reg, StringRef Src, SMDiagnostic &Error)
bool parseMachineMetadata(PerFunctionMIParsingState &PFS, StringRef Src, SMRange SourceRange, SMDiagnostic &Error)
bool parseVirtualRegisterReference(PerFunctionMIParsingState &PFS, VRegInfo *&Info, StringRef Src, SMDiagnostic &Error)
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
bool parseNamedRegisterReference(PerFunctionMIParsingState &PFS, Register &Reg, StringRef Src, SMDiagnostic &Error)
Definition MIParser.h:165
DenseMap< unsigned, unsigned > JumpTableSlots
Definition MIParser.h:181
SourceMgr * SM
Definition MIParser.h:168
VRegInfo & getVRegInfo(Register Num)
DenseMap< unsigned, int > FixedStackObjectSlots
Definition MIParser.h:178
const SlotMapping & IRSlots
Definition MIParser.h:169
const Value * getIRValue(unsigned Slot)
DenseMap< unsigned, unsigned > ConstantPoolSlots
Definition MIParser.h:180
DenseMap< unsigned, MachineBasicBlock * > MBBSlots
Definition MIParser.h:175
StringMap< VRegInfo * > VRegInfosNamed
Definition MIParser.h:177
std::map< unsigned, TrackingMDNodeRef > MachineMetadataNodes
Definition MIParser.h:172
DenseMap< unsigned, const Value * > Slots2Values
Maps from slot numbers to function's unnamed values.
Definition MIParser.h:184
DenseMap< unsigned, int > StackObjectSlots
Definition MIParser.h:179
PerFunctionMIParsingState(MachineFunction &MF, SourceMgr &SM, const SlotMapping &IRSlots, PerTargetMIParsingState &Target)
std::map< unsigned, std::pair< TempMDTuple, SMLoc > > MachineForwardRefMDNodes
Definition MIParser.h:173
PerTargetMIParsingState & Target
Definition MIParser.h:170
MachineFunction & MF
Definition MIParser.h:167
DenseMap< Register, VRegInfo * > VRegInfos
Definition MIParser.h:176
VRegInfo & getVRegInfoNamed(StringRef RegName)
BumpPtrAllocator Allocator
Definition MIParser.h:166
~PerTargetMIParsingState()=default
bool getVRegFlagValue(StringRef FlagName, uint8_t &FlagValue) const
PerTargetMIParsingState(const TargetSubtargetInfo &STI)
Definition MIParser.h:154
bool getDirectTargetFlag(StringRef Name, unsigned &Flag)
Try to convert a name of a direct target flag to the corresponding target flag.
const RegisterBank * getRegBank(StringRef Name)
Check if the given identifier is a name of a register bank.
bool parseInstrName(StringRef InstrName, unsigned &OpCode)
Try to convert an instruction name to an opcode.
unsigned getSubRegIndex(StringRef Name)
Check if the given identifier is a name of a subregister index.
bool getTargetIndex(StringRef Name, int &Index)
Try to convert a name of target index to the corresponding target index.
void setTarget(const TargetSubtargetInfo &NewSubtarget)
bool getRegisterByName(StringRef RegName, Register &Reg)
Try to convert a register name to a register number.
bool getMMOTargetFlag(StringRef Name, MachineMemOperand::Flags &Flag)
Try to convert a name of a MachineMemOperand target flag to the corresponding target flag.
bool getBitmaskTargetFlag(StringRef Name, unsigned &Flag)
Try to convert a name of a bitmask target flag to the corresponding target flag.
const TargetRegisterClass * getRegClass(StringRef Name)
Check if the given identifier is a name of a register class.
const uint32_t * getRegMask(StringRef Identifier)
Check if the given identifier is a name of a register mask.
This struct contains the mappings from the slot numbers to unnamed metadata nodes,...
const RegisterBank * RegBank
Definition MIParser.h:44
@ UNKNOWN
Definition MIParser.h:40
@ GENERIC
Definition MIParser.h:40
@ NORMAL
Definition MIParser.h:40
@ REGBANK
Definition MIParser.h:40
const TargetRegisterClass * RC
Definition MIParser.h:43
Register PreferredReg
Definition MIParser.h:47
Register VReg
Definition MIParser.h:46
bool Explicit
VReg was explicitly specified in the .mir file.
Definition MIParser.h:41
uint8_t Flags
Definition MIParser.h:48