[llvm-commits] [llvm] r121807 - /llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Dec 14 15:38:19 PST 2010
Author: stoklund
Date: Tue Dec 14 17:38:19 2010
New Revision: 121807
URL: http://llvm.org/viewvc/llvm-project?rev=121807&view=rev
Log:
Simplify RegAllocGreedy's use of register aliases.
Modified:
llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=121807&r1=121806&r2=121807&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Tue Dec 14 17:38:19 2010
@@ -154,11 +154,8 @@
// 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 @@
/// 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)
More information about the llvm-commits
mailing list