Go to the documentation of this file.
12 #ifndef LLVM_PROFILEDATA_INSTRPROFCORRELATOR_H
13 #define LLVM_PROFILEDATA_INSTRPROFCORRELATOR_H
50 return Ctx->CountersSectionEnd -
Ctx->CountersSectionStart;
65 std::unique_ptr<MemoryBuffer>
Buffer;
72 const std::unique_ptr<InstrProfCorrelator::Context>
Ctx;
82 get(std::unique_ptr<MemoryBuffer> Buffer);
89 template <
class IntPtrT>
98 return Data.empty() ? nullptr :
Data.data();
105 get(std::unique_ptr<InstrProfCorrelator::Context>
Ctx,
109 std::vector<RawInstrProf::ProfileData<IntPtrT>>
Data;
115 IntPtrT FunctionPtr,
uint32_t NumCounters);
119 std::unique_ptr<InstrProfCorrelator::Context>
Ctx)
124 template <
class T>
T maybeSwap(T
Value)
const {
131 template <
class IntPtrT>
135 std::unique_ptr<InstrProfCorrelator::Context>
Ctx)
140 std::unique_ptr<DWARFContext> DICtx;
147 static bool isDIEOfProbe(
const DWARFDie &Die);
174 void correlateProfileDataImpl()
override;
179 #endif // LLVM_PROFILEDATA_INSTRPROFCORRELATOR_H
This is an optimization pass for GlobalISel generic memory operations.
static const char * NumCountersAttributeName
llvm::Optional< size_t > getDataSize() const
Return the number of ProfileData elements.
uint64_t getCountersSectionSize() const
Return the size of the counters section in bytes.
DwarfInstrProfCorrelator(std::unique_ptr< DWARFContext > DICtx, std::unique_ptr< InstrProfCorrelator::Context > Ctx)
Error correlateProfileData() override
Construct a ProfileData vector used to correlate raw instrumentation data to their functions.
size_t getDataSize() const
Return the number of ProfileData elements.
static const char * CFGHashAttributeName
virtual void correlateProfileDataImpl()=0
Tagged union holding either a T or a Error.
InstrProfCorrelatorImpl - A child of InstrProfCorrelator with a template pointer type so that the Pro...
DwarfInstrProfCorrelator - A child of InstrProfCorrelatorImpl that takes DWARF debug info as input to...
InstrProfCorrelatorKind getKind() const
(vector float) vec_cmpeq(*A, *B) C
static const char * FunctionNameAttributeName
size_t getNamesSize() const
Return the number of bytes in the names string.
const std::unique_ptr< InstrProfCorrelator::Context > Ctx
const RawInstrProf::ProfileData< IntPtrT > * getDataPointer() const
Return a pointer to the underlying ProfileData vector that this class constructs.
bool ShouldSwapBytes
True if target and host have different endian orders.
uint64_t CountersSectionStart
The address range of the __llvm_prf_cnts section.
unsigned char getSwappedBytes(unsigned char C)
InstrProfCorrelatorImpl(std::unique_ptr< InstrProfCorrelator::Context > Ctx)
static llvm::Expected< std::unique_ptr< InstrProfCorrelator > > get(StringRef DebugInfoFilename)
bar al al movzbl eax ret Missed when stored in a memory object
const char * getNamesPointer() const
Return a pointer to the names string that this class constructs.
uint64_t CountersSectionEnd
std::vector< RawInstrProf::ProfileData< IntPtrT > > Data
virtual ~InstrProfCorrelator()=default
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
static bool classof(const InstrProfCorrelator *C)
static llvm::Expected< std::unique_ptr< Context > > get(std::unique_ptr< MemoryBuffer > Buffer, const object::ObjectFile &Obj)
std::unique_ptr< MemoryBuffer > Buffer
StringRef - Represent a constant reference to a string, i.e.
This class is the base class for all object file types.
static llvm::Expected< std::unique_ptr< InstrProfCorrelatorImpl< IntPtrT > > > get(std::unique_ptr< InstrProfCorrelator::Context > Ctx, const object::ObjectFile &Obj)
Lightweight error class with error context and mandatory checking.
virtual Error correlateProfileData()=0
Construct a ProfileData vector used to correlate raw instrumentation data to their functions.
InstrProfCorrelator - A base class used to create raw instrumentation data to their functions.
InstrProfCorrelator(InstrProfCorrelatorKind K, std::unique_ptr< Context > Ctx)
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
LLVM Value Representation.
std::vector< std::string > NamesVec
void addProbe(StringRef FunctionName, uint64_t CFGHash, IntPtrT CounterOffset, IntPtrT FunctionPtr, uint32_t NumCounters)