LLVM: include/llvm/SandboxIR/Region.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_SANDBOXIR_REGION_H
10#define LLVM_SANDBOXIR_REGION_H
11
13#include
14
20
22
24
25class ScoreBoard {
29
31
33
35
36 ScoreBoard(const ScoreBoard &) = delete;
37 const ScoreBoard &operator=(const ScoreBoard &) = delete;
38
39public:
41
43
45
47
49
50#ifndef NDEBUG
52 OS << "BeforeCost: " << BeforeCost << "\n";
53 OS << "AfterCost: " << AfterCost << "\n";
54 }
56#endif
57};
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
97
98
100
102
103
105 static constexpr const char *MDKind = "sandboxvec";
106 static constexpr const char *RegionStr = "sandboxregion";
107 static constexpr const char *AuxMDKind = "sandboxaux";
108
110
112
113
115
117
118
119
120
121
122
123
124
125
127
128
129 void add(Instruction *I) { addImpl(I, false); }
130
135
136
137
139
141
143
144public:
147
149
151
152 bool empty() const { return Insts.empty(); }
153
155
157
159
160 using iterator = decltype(Insts.begin());
164
167
169
170#ifndef NDEBUG
171
174
176 void dump() const;
178 Rgn.dump(OS);
179 return OS;
180 }
181#endif
182};
183
184
190
191}
192
193#endif
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
#define LLVM_ABI_FOR_TEST
This file implements a set that has insertion order iteration characteristics.
This pass exposes codegen information to IR-level passes.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A vector that has set insertion semantics.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
TargetCostKind
The kind of cost model.
@ TCK_RecipThroughput
Reciprocal throughput.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
An ID for a registered callback.
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
A helper client-attorney class for unit tests.
Definition Region.h:185
static void add(Region &Rgn, Instruction *I)
Definition Region.h:187
static void remove(Region &Rgn, Instruction *I)
Definition Region.h:188
The main job of the Region is to point to new instructions generated by vectorization passes.
Definition Region.h:96
Context & getContext() const
Definition Region.h:148
bool contains(Instruction *I) const
Returns true if I is in the Region.
Definition Region.h:150
const SmallVector< Instruction * > & getAux() const
\Returns the auxiliary vector.
Definition Region.h:156
iterator_range< iterator > insts()
Definition Region.h:163
bool operator!=(const Region &other) const
Definition Region.h:173
LLVM_ABI_FOR_TEST bool operator==(const Region &Other) const
This is an expensive check, meant for testing.
LLVM_ABI Region(Context &Ctx, TargetTransformInfo &TTI)
static LLVM_ABI SmallVector< std::unique_ptr< Region > > createRegionsFromMD(Function &F, TargetTransformInfo &TTI)
const ScoreBoard & getScoreboard() const
\Returns the ScoreBoard data structure that keeps track of instr costs.
Definition Region.h:168
friend class RegionInternalsAttorney
Definition Region.h:133
friend class Context
Definition Region.h:132
friend raw_ostream & operator<<(raw_ostream &OS, const Region &Rgn)
Definition Region.h:177
iterator begin()
Definition Region.h:161
LLVM_ABI void clearAux()
Clears all auxiliary data.
iterator end()
Definition Region.h:162
decltype(Insts.begin()) iterator
Definition Region.h:160
LLVM_ABI_FOR_TEST void dump(raw_ostream &OS) const
friend class RegionsFromBBs
Definition Region.h:134
bool empty() const
Returns true if the Region has no instructions.
Definition Region.h:152
InstructionCost getBeforeCost() const
\Returns the cost of the Removed instructions.
Definition Region.h:48
LLVM_ABI void remove(Instruction *I)
Mark I as a deleted instruction from the region.
InstructionCost getAfterCost() const
\Returns the cost of the newly added instructions.
Definition Region.h:46
ScoreBoard(Region &Rgn, TargetTransformInfo &TTI)
Definition Region.h:40
LLVM_DUMP_METHOD void dump() const
void dump(raw_ostream &OS) const
Definition Region.h:51
void add(Instruction *I)
Mark I as a newly added instruction to the region.
Definition Region.h:42
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.