14#ifndef LLVM_LIB_CODEGEN_INTERFERENCECACHE_H
15#define LLVM_LIB_CODEGEN_INTERFERENCECACHE_H
30class TargetRegisterInfo;
35 struct BlockInterference {
40 BlockInterference() =
default;
54 unsigned RefCount = 0;
86 VirtI.setMap(LIU.
getMap());
98 void update(
unsigned MBBNum);
104 assert(!hasRefs() &&
"Cannot clear cache entry with references");
105 PhysReg = MCRegister::NoRegister;
111 MCRegister getPhysReg()
const {
return PhysReg; }
113 void addRef(
int Delta) { RefCount += Delta; }
115 bool hasRefs()
const {
return RefCount > 0; }
127 BlockInterference *
get(
unsigned MBBNum) {
128 if (
Blocks[MBBNum].Tag != Tag)
145 unsigned char* PhysRegEntries =
nullptr;
146 size_t PhysRegEntriesCount = 0;
149 unsigned RoundRobin = 0;
162 free(PhysRegEntries);
165 void reinitPhysRegEntries();
178 Entry *CacheEntry =
nullptr;
179 const BlockInterference *Current =
nullptr;
180 static const BlockInterference NoInterference;
182 void setEntry(Entry *
E) {
187 CacheEntry->addRef(-1);
190 CacheEntry->addRef(+1);
198 setEntry(O.CacheEntry);
202 setEntry(O.CacheEntry);
214 setEntry(Cache.get(PhysReg));
219 Current = CacheEntry ? CacheEntry->get(MBBNum) : &NoInterference;
224 return Current->First.isValid();
230 return Current->First;
236 return Current->Last;
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static cl::opt< unsigned > CacheEntries("cdsort-cache-entries", cl::ReallyHidden, cl::desc("The size of the cache"))
#define LLVM_LIBRARY_VISIBILITY
DenseMap< Block *, BlockRelaxAux > Blocks
unsigned const TargetRegisterInfo * TRI
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
Cursor - The primary query interface for the block interference cache.
SlotIndex first()
first - Return the starting index of the first interfering range in the current block.
SlotIndex last()
last - Return the ending index of the last interfering range in the current block.
Cursor & operator=(const Cursor &O)
bool hasInterference()
hasInterference - Return true if the current block has any interference.
void moveToBlock(unsigned MBBNum)
moveTo - Move cursor to basic block MBBNum.
Cursor()=default
Cursor - Create a dangling cursor.
void setPhysReg(InterferenceCache &Cache, MCRegister PhysReg)
setPhysReg - Point this cursor to PhysReg's interference.
InterferenceCache & operator=(const InterferenceCache &other)=delete
InterferenceCache(const InterferenceCache &other)=delete
InterferenceCache()=default
unsigned getMaxCursors() const
getMaxCursors - Return the maximum number of concurrent cursors that can be supported.
Union of live intervals that are strong candidates for coalescing into a single register (either phys...
LiveSegments::iterator SegmentIter
unsigned getTag() const
getTag - Return an opaque tag representing the current state of the union.
const Map & getMap() const
This class represents the liveness of a register, stack slot, etc.
Wrapper class representing physical registers. Should be passed by value.
constexpr bool isValid() const
SlotIndex - An opaque wrapper around machine indexes.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)