diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-14 23:38:19 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-14 23:38:19 +0000 |
commit | 0b7ca3a6a70fa40dd6749a5748201590bdfa14e3 (patch) | |
tree | a64d0b55680b5c17391af18d43d68b0744399f13 | |
parent | 47b93401d8027b3d0124931bc28b026f9f7c5166 (diff) | |
download | bcm5719-llvm-0b7ca3a6a70fa40dd6749a5748201590bdfa14e3.tar.gz bcm5719-llvm-0b7ca3a6a70fa40dd6749a5748201590bdfa14e3.zip |
Simplify RegAllocGreedy's use of register aliases.
llvm-svn: 121807
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 1c58bbe2881..5d2cc9937de 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -154,11 +154,8 @@ float RAGreedy::getPriority(LiveInterval *LI) { // Check interference without using the cache. bool RAGreedy::checkUncachedInterference(LiveInterval &VirtReg, unsigned PhysReg) { - LiveIntervalUnion::Query subQ(&VirtReg, &PhysReg2LiveUnion[PhysReg]); - if (subQ.checkInterference()) - return true; - for (const unsigned *AliasI = TRI->getAliasSet(PhysReg); *AliasI; ++AliasI) { - subQ.init(&VirtReg, &PhysReg2LiveUnion[*AliasI]); + for (const unsigned *AliasI = TRI->getOverlaps(PhysReg); *AliasI; ++AliasI) { + LiveIntervalUnion::Query subQ(&VirtReg, &PhysReg2LiveUnion[*AliasI]); if (subQ.checkInterference()) return true; } @@ -170,19 +167,9 @@ bool RAGreedy::checkUncachedInterference(LiveInterval &VirtReg, /// interfering. LiveInterval *RAGreedy::getSingleInterference(LiveInterval &VirtReg, unsigned PhysReg) { + // Check physreg and aliases. LiveInterval *Interference = 0; - - // Check direct interferences. - LiveIntervalUnion::Query &Q = query(VirtReg, PhysReg); - if (Q.checkInterference()) { - Q.collectInterferingVRegs(1); - if (!Q.seenAllInterferences()) - return 0; - Interference = Q.interferingVRegs().front(); - } - - // Check aliases. - for (const unsigned *AliasI = TRI->getAliasSet(PhysReg); *AliasI; ++AliasI) { + for (const unsigned *AliasI = TRI->getOverlaps(PhysReg); *AliasI; ++AliasI) { LiveIntervalUnion::Query &Q = query(VirtReg, *AliasI); if (Q.checkInterference()) { if (Interference) |