summaryrefslogtreecommitdiff
path: root/lib/CodeGen/InterferenceCache.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-14 00:58:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-14 00:58:38 +0000
commit4fcfcf498436533ea9bc59404d10751bc76cfd2c (patch)
tree84f08aa3feb20f087d8bbca14ad08da6bc9bb6dc /lib/CodeGen/InterferenceCache.h
parent6a9feaac935c9345f825b272cf3225248e282f3f (diff)
downloadllvm-4fcfcf498436533ea9bc59404d10751bc76cfd2c.tar.gz
llvm-4fcfcf498436533ea9bc59404d10751bc76cfd2c.tar.bz2
llvm-4fcfcf498436533ea9bc59404d10751bc76cfd2c.tar.xz
Revert r135121 which broke a gcc-4.2 builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InterferenceCache.h')
-rw-r--r--lib/CodeGen/InterferenceCache.h43
1 files changed, 3 insertions, 40 deletions
diff --git a/lib/CodeGen/InterferenceCache.h b/lib/CodeGen/InterferenceCache.h
index 2f402e4048..6434b3a788 100644
--- a/lib/CodeGen/InterferenceCache.h
+++ b/lib/CodeGen/InterferenceCache.h
@@ -43,9 +43,6 @@ class InterferenceCache {
/// change.
unsigned Tag;
- /// RefCount - The total number of Cursor instances referring to this Entry.
- unsigned RefCount;
-
/// MF - The current function.
MachineFunction *MF;
@@ -71,10 +68,9 @@ class InterferenceCache {
void update(unsigned MBBNum);
public:
- Entry() : PhysReg(0), Tag(0), RefCount(0), Indexes(0) {}
+ Entry() : PhysReg(0), Tag(0), Indexes(0) {}
void clear(MachineFunction *mf, SlotIndexes *indexes) {
- assert(!hasRefs() && "Cannot clear cache entry with references");
PhysReg = 0;
MF = mf;
Indexes = indexes;
@@ -82,10 +78,6 @@ class InterferenceCache {
unsigned getPhysReg() const { return PhysReg; }
- void addRef(int Delta) { RefCount += Delta; }
-
- bool hasRefs() const { return RefCount > 0; }
-
void revalidate();
/// valid - Return true if this is a valid entry for physReg.
@@ -130,47 +122,18 @@ public:
void init(MachineFunction*, LiveIntervalUnion*, SlotIndexes*,
const TargetRegisterInfo *);
- /// getMaxCursors - Return the maximum number of concurrent cursors that can
- /// be supported.
- unsigned getMaxCursors() const { return CacheEntries; }
-
/// Cursor - The primary query interface for the block interference cache.
class Cursor {
Entry *CacheEntry;
BlockInterference *Current;
-
- void setEntry(Entry *E) {
- // Update reference counts. Nothing happens when RefCount reaches 0, so
- // we don't have to check for E == CacheEntry etc.
- if (CacheEntry)
- CacheEntry->addRef(-1);
- CacheEntry = E;
- if (CacheEntry)
- CacheEntry->addRef(+1);
- Current = 0;
- }
-
public:
/// Cursor - Create a dangling cursor.
Cursor() : CacheEntry(0), Current(0) {}
- ~Cursor() { setEntry(0); }
-
- Cursor(const Cursor &O) {
- setEntry(O.CacheEntry);
- }
-
- Cursor &operator=(const Cursor &O) {
- setEntry(O.CacheEntry);
- return *this;
- }
/// setPhysReg - Point this cursor to PhysReg's interference.
void setPhysReg(InterferenceCache &Cache, unsigned PhysReg) {
- // Release reference before getting a new one. That guarantees we can
- // actually have CacheEntries live cursors.
- setEntry(0);
- if (PhysReg)
- setEntry(Cache.get(PhysReg));
+ CacheEntry = Cache.get(PhysReg);
+ Current = 0;
}
/// moveTo - Move cursor to basic block MBBNum.