LLVM: include/llvm/CodeGen/ExecutionDomainFix.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef LLVM_CODEGEN_EXECUTIONDOMAINFIX_H
23#define LLVM_CODEGEN_EXECUTIONDOMAINFIX_H
24
30
31namespace llvm {
32
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
52
54
55
56
57
59
60
61
62
64
65
67
69
70
71
73
74
77 static_cast<unsigned>(std::numeric_limits::digits) &&
78 "undefined behavior");
80 }
81
82
85 static_cast<unsigned>(std::numeric_limits::digits) &&
86 "undefined behavior");
88 }
89
90
93 static_cast<unsigned>(std::numeric_limits::digits) &&
94 "undefined behavior");
96 }
97
98
102
103
107
108
111 Next = nullptr;
113 }
114};
115
119
124 std::vector<SmallVector<int, 1>> AliasMap;
125 const unsigned NumRegs;
126
127
128 using LiveRegsDVInfo = std::vector<DomainValue *>;
129 LiveRegsDVInfo LiveRegs;
130
131
132
134 OutRegsInfoMap MBBOutRegsInfos;
135
137
138public:
141
147
149
153
154private:
155
156
159
160
162
163
165 if (DV)
167 return DV;
168 }
169
170
171
172 void release(DomainValue *);
173
174
175
176 DomainValue *resolve(DomainValue *&);
177
178
179 void setLiveReg(int rx, DomainValue *DV);
180
181
182 void kill(int rx);
183
184
185 void force(int rx, unsigned domain);
186
187
188
189 void collapse(DomainValue *dv, unsigned domain);
190
191
192 bool merge(DomainValue *A, DomainValue *B);
193
194
195 void enterBasicBlock(const LoopTraversal::TraversedMBBInfo &TraversedMBB);
196
197
198 void leaveBasicBlock(const LoopTraversal::TraversedMBBInfo &TraversedMBB);
199
200
201 void processBasicBlock(const LoopTraversal::TraversedMBBInfo &TraversedMBB);
202
203
204 bool visitInstr(MachineInstr *);
205
206
207
208 void processDefs(MachineInstr *, bool Kill);
209
210
211 void visitSoftInstr(MachineInstr *, unsigned mask);
212
213
214
215 void visitHardInstr(MachineInstr *, unsigned domain);
216};
217
218}
219
220#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static constexpr unsigned long long mask(BlockVerifier::State S)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static LoopDeletionResult merge(LoopDeletionResult A, LoopDeletionResult B)
This file defines the SmallVector class.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition ExecutionDomainFix.h:142
ExecutionDomainFix(char &PassID, const TargetRegisterClass &RC)
Definition ExecutionDomainFix.h:139
MachineFunctionProperties getRequiredProperties() const override
Definition ExecutionDomainFix.h:150
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Wrapper class representing physical registers. Should be passed by value.
MachineFunctionPass(char &ID)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Properties which a MachineFunction may have at a given point in time.
Representation of each machine instruction.
This class provides the reaching def analysis.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A BumpPtrAllocator that allows only elements of a specific type to be allocated.
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
A range adaptor for a pair of iterators.
This is an optimization pass for GlobalISel generic memory operations.
int countr_zero(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
A DomainValue is a bit like LiveIntervals' ValNo, but it also keeps track of execution domains.
Definition ExecutionDomainFix.h:51
unsigned getCommonDomains(unsigned mask) const
Return bitmask of domains that are available and in mask.
Definition ExecutionDomainFix.h:99
void clear()
Clear this DomainValue and point to next which has all its data.
Definition ExecutionDomainFix.h:109
SmallVector< MachineInstr *, 8 > Instrs
Twiddleable instructions using or defining these registers.
Definition ExecutionDomainFix.h:66
void setSingleDomain(unsigned domain)
Definition ExecutionDomainFix.h:91
DomainValue()
Definition ExecutionDomainFix.h:68
bool isCollapsed() const
A collapsed DomainValue has no instructions to twiddle - it simply keeps track of the domains where t...
Definition ExecutionDomainFix.h:72
DomainValue * Next
Pointer to the next DomainValue in a chain.
Definition ExecutionDomainFix.h:63
void addDomain(unsigned domain)
Mark domain as available.
Definition ExecutionDomainFix.h:83
unsigned AvailableDomains
Bitmask of available domains.
Definition ExecutionDomainFix.h:58
unsigned Refs
Basic reference counting.
Definition ExecutionDomainFix.h:53
unsigned getFirstDomain() const
First domain available.
Definition ExecutionDomainFix.h:104
bool hasDomain(unsigned domain) const
Is domain available?
Definition ExecutionDomainFix.h:75