Skip to content

Commit

Permalink
Now that we are deleting unused live intervals during allocation, poi…
Browse files Browse the repository at this point in the history
…nters may be reused.

Use the virtual register number as a cache tag instead. They are not reused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127561 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
stoklund committed Mar 13, 2011
1 parent 7792e98 commit 5522e8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/CodeGen/LiveIntervalUnion.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class LiveIntervalUnion {
bool CheckedFirstInterference;
bool SeenAllInterferences;
bool SeenUnspillableVReg;
unsigned Tag;
unsigned Tag, VTag;

public:
Query(): LiveUnion(), VirtReg() {}
Expand All @@ -181,18 +181,20 @@ class LiveIntervalUnion {
SeenAllInterferences = false;
SeenUnspillableVReg = false;
Tag = 0;
VTag = 0;
}

void init(LiveInterval *VReg, LiveIntervalUnion *LIU) {
assert(VReg && LIU && "Invalid arguments");
if (VirtReg == VReg && LiveUnion == LIU && !LIU->changedSince(Tag)) {
if (VReg->reg == VTag && LiveUnion == LIU && !LIU->changedSince(Tag)) {
// Retain cached results, e.g. firstInterference.
return;
}
clear();
LiveUnion = LIU;
VirtReg = VReg;
Tag = LIU->getTag();
VTag = VReg->reg;
}

LiveInterval &virtReg() const {
Expand Down

0 comments on commit 5522e8a

Please sign in to comment.