summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-18 00:23:47 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-18 00:23:47 +0000
commit8575110ae188294adaf2ac766cd5427fb99c5e8a (patch)
tree9e025d2a46d38db11ba0876d4d39f15338164479 /llvm
parent68333f5c6e7ea576a94007a761fc681c0e79ff95 (diff)
downloadbcm5719-llvm-8575110ae188294adaf2ac766cd5427fb99c5e8a.tar.gz
bcm5719-llvm-8575110ae188294adaf2ac766cd5427fb99c5e8a.zip
Revert "Change coalescer complexity from N^2 to N logN by changing one letter."
This reverts commit 98776. It broke the llvm-gcc boot strap. llvm-svn: 98784
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 2c1892de9c1..5c621181cd9 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -1682,9 +1682,20 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
// density, do not join them, instead mark the physical register as its
// allocation preference.
LiveInterval &JoinVInt = SrcIsPhys ? DstInt : SrcInt;
+ LiveInterval &JoinPInt = SrcIsPhys ? SrcInt : DstInt;
unsigned JoinVReg = SrcIsPhys ? DstReg : SrcReg;
unsigned JoinPReg = SrcIsPhys ? SrcReg : DstReg;
+ // Don't join with physregs that have a ridiculous number of live
+ // ranges. The data structure performance is really bad when that
+ // happens.
+ if (JoinPInt.ranges.size() > 1000) {
+ mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
+ ++numAborts;
+ DEBUG(dbgs() << "\tPhysical register too complicated, abort!\n");
+ return false;
+ }
+
const TargetRegisterClass *RC = mri_->getRegClass(JoinVReg);
unsigned Threshold = allocatableRCRegs_[RC].count() * 2;
unsigned Length = li_->getApproximateInstructionCount(JoinVInt);
@@ -2159,7 +2170,7 @@ bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS){
// Update the liveintervals of sub-registers.
if (TargetRegisterInfo::isPhysicalRegister(LHS.reg))
for (const unsigned *AS = tri_->getSubRegisters(LHS.reg); *AS; ++AS)
- li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, RHS,
+ li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, LHS,
li_->getVNInfoAllocator());
return true;
OpenPOWER on IntegriCloud