diff options
author | Andrew Trick <atrick@apple.com> | 2010-11-10 19:18:47 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2010-11-10 19:18:47 +0000 |
commit | 89eb6a8b94e054b5afaf87969fd24d9ceb7b92dc (patch) | |
tree | cbb84d3c4c9602535bacf26ea9dbe6b75a9bb7b2 /llvm/lib/CodeGen/RegAllocBase.h | |
parent | 5c2816d90339aa65da636dd538b95a9721d6b8c6 (diff) | |
download | bcm5719-llvm-89eb6a8b94e054b5afaf87969fd24d9ceb7b92dc.tar.gz bcm5719-llvm-89eb6a8b94e054b5afaf87969fd24d9ceb7b92dc.zip |
RABasic is nearly functionally complete. There are a few remaining
benchmarks hitting an assertion.
Adds LiveIntervalUnion::collectInterferingVRegs.
Fixes "late spilling" by checking for any unspillable live vregs among
all physReg aliases.
llvm-svn: 118701
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBase.h')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocBase.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBase.h b/llvm/lib/CodeGen/RegAllocBase.h index fa595fed8b5..8c3971dee14 100644 --- a/llvm/lib/CodeGen/RegAllocBase.h +++ b/llvm/lib/CodeGen/RegAllocBase.h @@ -45,6 +45,7 @@ template<typename T> class SmallVectorImpl; class TargetRegisterInfo; class VirtRegMap; class LiveIntervals; +class Spiller; // Heuristic that determines the priority of assigning virtual to physical // registers. The main impact of the heuristic is expected to be compile time. @@ -113,6 +114,9 @@ protected: // LiveVirtRegQueue. void allocatePhysRegs(); + // Get a temporary reference to a Spiller instance. + virtual Spiller &spiller() = 0; + // A RegAlloc pass should override this to provide the allocation heuristics. // Each call must guarantee forward progess by returning an available PhysReg // or new set of split live virtual registers. It is up to the splitter to @@ -128,18 +132,21 @@ protected: // exists, return the interfering register, which may be preg or an alias. unsigned checkPhysRegInterference(LiveInterval& lvr, unsigned preg); + // 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, + SmallVectorImpl<LiveInterval*> &splitLVRs); + #ifndef NDEBUG // Verify each LiveIntervalUnion. void verify(); #endif - // 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); + + void spillReg(unsigned reg, SmallVectorImpl<LiveInterval*> &splitLVRs); }; } // end namespace llvm |