summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocBase.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2010-11-08 18:02:08 +0000
committerAndrew Trick <atrick@apple.com>2010-11-08 18:02:08 +0000
commite141a4960f702bef957b28abde3801ec64e32d87 (patch)
tree7a224ffe3721534e2ac8c8cfd7f58f860fba418f /lib/CodeGen/RegAllocBase.h
parent69ad7138b7f8a884e0fb2ebf103c47d786ada8c7 (diff)
downloadllvm-e141a4960f702bef957b28abde3801ec64e32d87.tar.gz
llvm-e141a4960f702bef957b28abde3801ec64e32d87.tar.bz2
llvm-e141a4960f702bef957b28abde3801ec64e32d87.tar.xz
Adds support for spilling previously allocated live intervals to
handle cases in which a register is unavailable for spill code. Adds LiveIntervalUnion::extract. While processing interferences on a live virtual register, reuses the same Query object for each physcial reg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocBase.h')
-rw-r--r--lib/CodeGen/RegAllocBase.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/CodeGen/RegAllocBase.h b/lib/CodeGen/RegAllocBase.h
index 1534c0d7eb..f4ca972738 100644
--- a/lib/CodeGen/RegAllocBase.h
+++ b/lib/CodeGen/RegAllocBase.h
@@ -94,6 +94,10 @@ protected:
LiveIntervals *lis_;
LIUArray physReg2liu_;
+ // Current queries, one per physreg. They must be reinitialized each time we
+ // query on a new live virtual register.
+ OwningArrayPtr<LiveIntervalUnion::Query> queries_;
+
RegAllocBase(): tri_(0), vrm_(0), lis_(0) {}
virtual ~RegAllocBase() {}
@@ -120,9 +124,15 @@ protected:
virtual void releaseMemory();
// Helper for checking interference between a live virtual register and a
- // physical register, including all its register aliases.
- bool checkPhysRegInterference(LiveIntervalUnion::Query &query, unsigned preg);
-
+ // physical register, including all its register aliases. If an interference
+ // exists, return the interfering register, which may be preg or an alias.
+ unsigned checkPhysRegInterference(LiveInterval& lvr, unsigned preg);
+
+ // Helper that spills all live virtual registers currently unified under preg
+ // that interfere with the most recently queried lvr.
+ void spillInterferences(unsigned preg,
+ SmallVectorImpl<LiveInterval*> &splitLVRs);
+
private:
void seedLiveVirtRegs(LiveVirtRegQueue &lvrQ);
};