summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocBase.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2010-11-11 17:46:29 +0000
committerAndrew Trick <atrick@apple.com>2010-11-11 17:46:29 +0000
commitf11344d770dd781144d073c0ee2aef792b77ee7a (patch)
tree1556d12ab3434bddfa08f66bf3c94efd20ed4387 /llvm/lib/CodeGen/RegAllocBase.h
parent109dfe55d0cc73aedb01d0d95c5885e7319a8f40 (diff)
downloadbcm5719-llvm-f11344d770dd781144d073c0ee2aef792b77ee7a.tar.gz
bcm5719-llvm-f11344d770dd781144d073c0ee2aef792b77ee7a.zip
Check TRI->getReservedRegs because other allocators do it. Even though
it makes no sense for allocation_order iterators to visit reserved regs. The inline spiller depends on AliasAnalysis. Manage the Query state to avoid uninitialized or stale results. llvm-svn: 118800
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBase.h')
-rw-r--r--llvm/lib/CodeGen/RegAllocBase.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBase.h b/llvm/lib/CodeGen/RegAllocBase.h
index 8c3971dee14..c8c78567f87 100644
--- a/llvm/lib/CodeGen/RegAllocBase.h
+++ b/llvm/lib/CodeGen/RegAllocBase.h
@@ -106,6 +106,15 @@ protected:
// A RegAlloc pass should call this before allocatePhysRegs.
void init(const TargetRegisterInfo &tri, VirtRegMap &vrm, LiveIntervals &lis);
+ // Get an initialized query to check interferences between lvr and preg. Note
+ // that Query::init must be called at least once for each physical register
+ // before querying a new live virtual register. This ties queries_ and
+ // physReg2liu_ together.
+ LiveIntervalUnion::Query &query(LiveInterval &lvr, unsigned preg) {
+ queries_[preg].init(&lvr, &physReg2liu_[preg]);
+ return queries_[preg];
+ }
+
// The top-level driver. The output is a VirtRegMap that us updated with
// physical register assignments.
//
@@ -135,7 +144,7 @@ protected:
// Helper for spilling all live virtual registers currently unified under preg
// that interfere with the most recently queried lvr. Return true if spilling
// was successful, and append any new spilled/split intervals to splitLVRs.
- bool spillInterferences(unsigned preg,
+ bool spillInterferences(LiveInterval &lvr, unsigned preg,
SmallVectorImpl<LiveInterval*> &splitLVRs);
#ifndef NDEBUG
@@ -146,7 +155,8 @@ protected:
private:
void seedLiveVirtRegs(LiveVirtRegQueue &lvrQ);
- void spillReg(unsigned reg, SmallVectorImpl<LiveInterval*> &splitLVRs);
+ void spillReg(LiveInterval &lvr, unsigned reg,
+ SmallVectorImpl<LiveInterval*> &splitLVRs);
};
} // end namespace llvm
OpenPOWER on IntegriCloud