summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalUnion.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-09 01:06:52 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-09 01:06:52 +0000
commita35cce1a14d8eee7e250e02b03903a5096d22c2f (patch)
treed5cc5f0114d22c6c37bb427536188e6393a3ca3d /lib/CodeGen/LiveIntervalUnion.h
parent0a29c270b53f15723811783c572d06b9500a7e8f (diff)
downloadllvm-a35cce1a14d8eee7e250e02b03903a5096d22c2f.tar.gz
llvm-a35cce1a14d8eee7e250e02b03903a5096d22c2f.tar.bz2
llvm-a35cce1a14d8eee7e250e02b03903a5096d22c2f.tar.xz
IntervalMap iterators are heavyweight, so avoid copying them around and use
references instead. Similarly, IntervalMap::begin() is almost as expensive as find(), so use find(x) instead of begin().advanceTo(x); This makes RegAllocBasic run another 5% faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121344 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalUnion.h')
-rw-r--r--lib/CodeGen/LiveIntervalUnion.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/LiveIntervalUnion.h b/lib/CodeGen/LiveIntervalUnion.h
index 0c9a13a606..442558218c 100644
--- a/lib/CodeGen/LiveIntervalUnion.h
+++ b/lib/CodeGen/LiveIntervalUnion.h
@@ -75,7 +75,9 @@ public:
// by their starting position.
SegmentIter begin() { return Segments.begin(); }
SegmentIter end() { return Segments.end(); }
+ SegmentIter find(SlotIndex x) { return Segments.find(x); }
bool empty() { return Segments.empty(); }
+ SlotIndex startIndex() { return Segments.start(); }
// Add a live virtual register to this union and merge its segments.
void unify(LiveInterval &VirtReg);
@@ -135,6 +137,7 @@ public:
LiveInterval *VirtReg;
InterferenceResult FirstInterference;
SmallVector<LiveInterval*,4> InterferingVRegs;
+ bool CheckedFirstInterference;
bool SeenAllInterferences;
bool SeenUnspillableVReg;
@@ -149,8 +152,8 @@ public:
void clear() {
LiveUnion = NULL;
VirtReg = NULL;
- FirstInterference = InterferenceResult();
InterferingVRegs.clear();
+ CheckedFirstInterference = false;
SeenAllInterferences = false;
SeenUnspillableVReg = false;
}
@@ -187,7 +190,7 @@ public:
// Get the first pair of interfering segments, or a noninterfering result.
// This initializes the firstInterference_ cache.
- InterferenceResult firstInterference();
+ const InterferenceResult &firstInterference();
// Treat the result as an iterator and advance to the next interfering pair
// of segments. Visiting each unique interfering pairs means that the same