summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocBase.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-20 22:52:24 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-20 22:52:24 +0000
commit812cda9a5cc26b1f8dda6f909bf5062c215b65d7 (patch)
tree87bc7026acaa8316786b6a087b6223af4d709ec7 /lib/CodeGen/RegAllocBase.cpp
parent797e9a7737136a5e13d9114fe11543da471f9bdc (diff)
downloadllvm-812cda9a5cc26b1f8dda6f909bf5062c215b65d7.tar.gz
llvm-812cda9a5cc26b1f8dda6f909bf5062c215b65d7.tar.bz2
llvm-812cda9a5cc26b1f8dda6f909bf5062c215b65d7.tar.xz
Convert RABasic to using LiveRegMatrix interference checking.
Stop using the LiveIntervalUnions provided by RegAllocBase, they will be removed soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocBase.cpp')
-rw-r--r--lib/CodeGen/RegAllocBase.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocBase.cpp b/lib/CodeGen/RegAllocBase.cpp
index f4774dcab0..1f824a8fdb 100644
--- a/lib/CodeGen/RegAllocBase.cpp
+++ b/lib/CodeGen/RegAllocBase.cpp
@@ -14,6 +14,7 @@
#define DEBUG_TYPE "regalloc"
#include "RegAllocBase.h"
+#include "LiveRegMatrix.h"
#include "Spiller.h"
#include "VirtRegMap.h"
#include "llvm/ADT/Statistic.h"
@@ -134,6 +135,11 @@ void RegAllocBase::seedLiveRegs() {
}
void RegAllocBase::assign(LiveInterval &VirtReg, unsigned PhysReg) {
+ // FIXME: This diversion is temporary.
+ if (Matrix) {
+ Matrix->assign(VirtReg, PhysReg);
+ return;
+ }
DEBUG(dbgs() << "assigning " << PrintReg(VirtReg.reg, TRI)
<< " to " << PrintReg(PhysReg, TRI) << '\n');
assert(!VRM->hasPhys(VirtReg.reg) && "Duplicate VirtReg assignment");
@@ -144,6 +150,11 @@ void RegAllocBase::assign(LiveInterval &VirtReg, unsigned PhysReg) {
}
void RegAllocBase::unassign(LiveInterval &VirtReg, unsigned PhysReg) {
+ // FIXME: This diversion is temporary.
+ if (Matrix) {
+ Matrix->unassign(VirtReg);
+ return;
+ }
DEBUG(dbgs() << "unassigning " << PrintReg(VirtReg.reg, TRI)
<< " from " << PrintReg(PhysReg, TRI) << '\n');
assert(VRM->getPhys(VirtReg.reg) == PhysReg && "Inconsistent unassign");
@@ -170,6 +181,8 @@ void RegAllocBase::allocatePhysRegs() {
// Invalidate all interference queries, live ranges could have changed.
invalidateVirtRegs();
+ if (Matrix)
+ Matrix->invalidateVirtRegs();
// selectOrSplit requests the allocator to return an available physical
// register if possible and populate a list of new live intervals that