summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocBase.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-09 01:14:03 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-09 01:14:03 +0000
commit2710638db2eb84cd7eefb8bb9a1b7e5c49413d45 (patch)
tree94eb0449093393b76f1a8f12079c8640c8456f97 /lib/CodeGen/RegAllocBase.h
parentc3dca3f9d4a049102fa985aedbc65e53f4cf6c0d (diff)
downloadllvm-2710638db2eb84cd7eefb8bb9a1b7e5c49413d45.tar.gz
llvm-2710638db2eb84cd7eefb8bb9a1b7e5c49413d45.tar.bz2
llvm-2710638db2eb84cd7eefb8bb9a1b7e5c49413d45.tar.xz
Evict a lighter single interference before attempting to split a live range.
Registers are not allocated strictly in spill weight order when live range splitting and spilling has created new shorter intervals with higher spill weights. When one of the new heavy intervals conflicts with a single lighter interval, simply evict the old interval instead of trying to split the heavy one. The lighter interval is a better candidate for splitting, it has a smaller use density. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocBase.h')
-rw-r--r--lib/CodeGen/RegAllocBase.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocBase.h b/lib/CodeGen/RegAllocBase.h
index a0416d27d8..8c7e5f53b8 100644
--- a/lib/CodeGen/RegAllocBase.h
+++ b/lib/CodeGen/RegAllocBase.h
@@ -139,6 +139,15 @@ protected:
// exists, return the interfering register, which may be preg or an alias.
unsigned checkPhysRegInterference(LiveInterval& VirtReg, unsigned PhysReg);
+ /// assign - Assign VirtReg to PhysReg.
+ /// This should not be called from selectOrSplit for the current register.
+ void assign(LiveInterval &VirtReg, unsigned PhysReg);
+
+ /// unassign - Undo a previous assignment of VirtReg to PhysReg.
+ /// This can be invoked from selectOrSplit, but be careful to guarantee that
+ /// allocation is making progress.
+ void unassign(LiveInterval &VirtReg, unsigned PhysReg);
+
// 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.