LLVM: include/llvm/CodeGen/BasicBlockSectionsProfileReader.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_CODEGEN_BASICBLOCKSECTIONSPROFILEREADER_H
16#define LLVM_CODEGEN_BASICBLOCKSECTIONSPROFILEREADER_H
17
31
32namespace llvm {
33
34
35
44
45
47
49
50
51
53
55
57
58
59
61};
62
64public:
67 : MBuf(Buf), LineIt(*Buf, true, '#'){};
68
70
71
72
74
75
76
79
80
83
84
85
88
89
90 std::pair<bool, FunctionPathAndClusterInfo>
92
93private:
95 auto R = FuncAliasMap.find(FuncName);
96 return R == FuncAliasMap.end() ? FuncName : R->second;
97 }
98
99
100 Error createProfileParseError(Twine Message) const {
105 }
106
107
108
109
110
111 Expected parseUniqueBBID(StringRef S) const;
112
113
114 Error ReadProfile();
115
116
117
118 Error ReadV0Profile();
119
120
121 Error ReadV1Profile();
122
123
124 const MemoryBuffer *MBuf = nullptr;
125
126
127 line_iterator LineIt;
128
129
130
131 StringMap<SmallString<128>> FunctionNameToDIFilename;
132
133
134
135
136
137
138
139 StringMap ProgramPathAndClusterInfo;
140
141
142
143 StringMap FuncAliasMap;
144};
145
146
147
148
151
152
153
154
155
157 : public AnalysisInfoMixin {
158
159public:
163
165
166private:
168};
169
171public:
174
180
186
188 return "Basic Block Sections Profile Reader";
189 }
190
192
195
198
201
202 std::pair<bool, FunctionPathAndClusterInfo>
204
205
206
208
210};
211
212}
213#endif
This file defines the StringMap class.
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
This file defines the SmallString class.
This file defines the SmallVector class.
BasicBlockSectionsProfileReaderAnalysis(const TargetMachine &TM)
Definition BasicBlockSectionsProfileReader.h:162
BasicBlockSectionsProfileReader Result
Definition BasicBlockSectionsProfileReader.h:161
Result run(Function &F, FunctionAnalysisManager &AM)
static AnalysisKey Key
Definition BasicBlockSectionsProfileReader.h:160
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
static char ID
Definition BasicBlockSectionsProfileReader.h:172
BasicBlockSectionsProfileReader BBSPR
Definition BasicBlockSectionsProfileReader.h:173
BasicBlockSectionsProfileReader & getBBSPR()
SmallVector< SmallVector< unsigned > > getClonePathsForFunction(StringRef FuncName) const
SmallVector< BBClusterInfo > getClusterInfoForFunction(StringRef FuncName) const
bool isFunctionHot(StringRef FuncName) const
BasicBlockSectionsProfileReaderWrapperPass()
Definition BasicBlockSectionsProfileReader.h:181
std::pair< bool, FunctionPathAndClusterInfo > getFunctionPathAndClusterInfo(StringRef FuncName) const
uint64_t getEdgeCount(StringRef FuncName, const UniqueBBID &SrcBBID, const UniqueBBID &DestBBID) const
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition BasicBlockSectionsProfileReader.h:187
BasicBlockSectionsProfileReaderWrapperPass(const MemoryBuffer *Buf)
Definition BasicBlockSectionsProfileReader.h:175
std::pair< bool, FunctionPathAndClusterInfo > getFunctionPathAndClusterInfo(StringRef FuncName) const
friend class BasicBlockSectionsProfileReaderWrapperPass
Definition BasicBlockSectionsProfileReader.h:65
bool isFunctionHot(StringRef FuncName) const
SmallVector< SmallVector< unsigned > > getClonePathsForFunction(StringRef FuncName) const
uint64_t getEdgeCount(StringRef FuncName, const UniqueBBID &SrcBBID, const UniqueBBID &SinkBBID) const
BasicBlockSectionsProfileReader(const MemoryBuffer *Buf)
Definition BasicBlockSectionsProfileReader.h:66
BasicBlockSectionsProfileReader()=default
SmallVector< BBClusterInfo > getClusterInfoForFunction(StringRef FuncName) const
Lightweight error class with error context and mandatory checking.
ImmutablePass class - This class is used to provide information that does not need to be run.
This interface provides simple read-only access to a block of memory, and provides simple methods for...
virtual StringRef getBufferIdentifier() const
Return an identifier for this buffer, typically the filename it was read from.
A Module instance is used to store all the information related to an LLVM module.
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
int64_t line_number() const
Return the current line number. May return any number at EOF.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void initializeBasicBlockSectionsProfileReaderWrapperPassPass(PassRegistry &)
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
ImmutablePass * createBasicBlockSectionsProfileReaderWrapperPass(const MemoryBuffer *Buf)
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
unsigned PositionInCluster
Definition BasicBlockSectionsProfileReader.h:42
unsigned ClusterID
Definition BasicBlockSectionsProfileReader.h:40
UniqueBBID BBID
Definition BasicBlockSectionsProfileReader.h:38
DenseMap< unsigned, uint64_t > BBHashes
Definition BasicBlockSectionsProfileReader.h:60
SmallVector< BBClusterInfo > ClusterInfo
Definition BasicBlockSectionsProfileReader.h:48
DenseMap< UniqueBBID, DenseMap< UniqueBBID, uint64_t > > EdgeCounts
Definition BasicBlockSectionsProfileReader.h:56
DenseMap< UniqueBBID, uint64_t > NodeCounts
Definition BasicBlockSectionsProfileReader.h:54
SmallVector< SmallVector< unsigned > > ClonePaths
Definition BasicBlockSectionsProfileReader.h:52