42#ifndef LLVM_SUPPORT_DEBUGCOUNTER_H
43#define LLVM_SUPPORT_DEBUGCOUNTER_H
108 auto Result = Us.Counters.find(
ID);
109 assert(Result != Us.Counters.end() &&
"Asking about a non-set counter");
110 return {Result->second.Count, Result->second.CurrChunkIdx};
116 auto &Counter = Us.Counters[
ID];
117 Counter.Count = State.
Count;
118 Counter.CurrChunkIdx = State.
ChunkIdx;
190#define DEBUG_COUNTER(VARNAME, COUNTERNAME, DESC) \
191 static const unsigned VARNAME = \
192 DebugCounter::registerCounter(COUNTERNAME, DESC)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This file defines the DenseMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static CounterState getCounterState(unsigned ID)
static void printChunks(raw_ostream &OS, ArrayRef< Chunk >)
CounterVector::const_iterator end() const
CounterVector::const_iterator begin() const
DenseMap< unsigned, CounterInfo > Counters
static bool isCounterSet(unsigned ID)
static bool shouldExecute(unsigned CounterName)
CounterVector RegisteredCounters
std::pair< std::string, std::string > getCounterInfo(unsigned ID) const
void push_back(const std::string &)
static bool isCountingEnabled()
unsigned getCounterId(const std::string &Name) const
static bool shouldExecuteImpl(unsigned CounterName)
static unsigned registerCounter(StringRef Name, StringRef Desc)
UniqueVector< std::string > CounterVector
unsigned addCounter(const std::string &Name, const std::string &Desc)
static void enableAllCounters()
static bool parseChunks(StringRef Str, SmallVector< Chunk > &Res)
Return true on parsing error and print the error message on the llvm::errs()
static DebugCounter & instance()
Returns a reference to the singleton instance.
void print(raw_ostream &OS) const
LLVM_DUMP_METHOD void dump() const
static void setCounterState(unsigned ID, CounterState State)
unsigned int getNumCounters() const
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.
UniqueVector - This class produces a sequential ID number (base 1) for each unique entry that is adde...
typename VectorType::const_iterator const_iterator
unsigned insert(const T &Entry)
insert - Append entry to the vector if it doesn't already exist.
size_t size() const
size - Returns the number of entries in the vector.
iterator end()
Return an iterator to the end of the vector.
unsigned idFor(const T &Entry) const
idFor - return the ID for an existing entry.
iterator begin()
Return an iterator to the start of the vector.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
Description of the encoding of one expression Op.
void print(llvm::raw_ostream &OS)
bool contains(int64_t Idx)
SmallVector< Chunk > Chunks