aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocBase.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2010-11-10 19:18:47 +0000
committerAndrew Trick <atrick@apple.com>2010-11-10 19:18:47 +0000
commitf4baeaf8485f01beda46d29fd55753199dc68070 (patch)
treec68e38a26d46da8c8a357d8910cf28cf5f219b09 /lib/CodeGen/RegAllocBase.h
parent4283f4b81e8c1cbf5c7a7b51e949e109ae25ff8c (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocBase.h')
-rw-r--r--lib/CodeGen/RegAllocBase.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/CodeGen/RegAllocBase.h b/lib/CodeGen/RegAllocBase.h
index fa595fed8b..8c3971dee1 100644
--- a/lib/CodeGen/RegAllocBase.h
+++ b/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