15#ifndef LLVM_CODEGEN_BASICBLOCKSECTIONSPROFILEREADER_H
16#define LLVM_CODEGEN_BASICBLOCKSECTIONSPROFILEREADER_H
66 std::pair<unsigned, unsigned> PairVal =
80 : MBuf(Buf), LineIt(*Buf,
true,
'#'){};
94 std::pair<bool, SmallVector<BBClusterInfo>>
103 auto R = FuncAliasMap.find(FuncName);
104 return R == FuncAliasMap.end() ? FuncName : R->second;
108 Error createProfileParseError(
Twine Message)
const {
109 return make_error<StringError>(
119 Expected<UniqueBBID> parseUniqueBBID(StringRef S)
const;
126 Error ReadV0Profile();
129 Error ReadV1Profile();
132 const MemoryBuffer *MBuf =
nullptr;
135 line_iterator LineIt;
139 StringMap<SmallString<128>> FunctionNameToDIFilename;
147 StringMap<FunctionPathAndClusterInfo> ProgramPathAndClusterInfo;
151 StringMap<StringRef> FuncAliasMap;
196 return "Basic Block Sections Profile Reader";
201 std::pair<bool, SmallVector<BBClusterInfo>>
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.
A container for analyses that lazily runs them and caches their results.
Analysis pass providing the BasicBlockSectionsProfileReader.
BasicBlockSectionsProfileReader Result
Result run(Function &F, FunctionAnalysisManager &AM)
BasicBlockSectionsProfileReaderAnalysis(const TargetMachine *TM)
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
BasicBlockSectionsProfileReader BBSPR
BasicBlockSectionsProfileReader & getBBSPR()
SmallVector< SmallVector< unsigned > > getClonePathsForFunction(StringRef FuncName) const
bool isFunctionHot(StringRef FuncName) const
BasicBlockSectionsProfileReaderWrapperPass()
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
std::pair< bool, SmallVector< BBClusterInfo > > getClusterInfoForFunction(StringRef FuncName) const
BasicBlockSectionsProfileReaderWrapperPass(const MemoryBuffer *Buf)
bool isFunctionHot(StringRef FuncName) const
std::pair< bool, SmallVector< BBClusterInfo > > getClusterInfoForFunction(StringRef FuncName) const
SmallVector< SmallVector< unsigned > > getClonePathsForFunction(StringRef FuncName) const
BasicBlockSectionsProfileReader(const MemoryBuffer *Buf)
BasicBlockSectionsProfileReader()
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 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.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
void initializeBasicBlockSectionsProfileReaderWrapperPassPass(PassRegistry &)
ImmutablePass * createBasicBlockSectionsProfileReaderWrapperPass(const MemoryBuffer *Buf)
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
static bool isEqual(const UniqueBBID &LHS, const UniqueBBID &RHS)
static UniqueBBID getEmptyKey()
static unsigned getHashValue(const UniqueBBID &Val)
static UniqueBBID getTombstoneKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...
SmallVector< BBClusterInfo > ClusterInfo
SmallVector< SmallVector< unsigned > > ClonePaths