diff options
Diffstat (limited to 'lib/CodeGen/RegAllocBase.h')
-rw-r--r-- | lib/CodeGen/RegAllocBase.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocBase.h b/lib/CodeGen/RegAllocBase.h index 8c3971dee1..c8c78567f8 100644 --- a/lib/CodeGen/RegAllocBase.h +++ b/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 |