summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-17 23:21:58 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-03-17 23:21:58 +0000
commit6589f7152e52a3f5901cb93e23acffc0158b5be9 (patch)
tree2f0c406652256fa13c65f21a3d805bc6dcd57233 /llvm/lib/CodeGen
parent0910b5afacf35704c854f103b7ecca03e3e11f28 (diff)
downloadbcm5719-llvm-6589f7152e52a3f5901cb93e23acffc0158b5be9.tar.gz
bcm5719-llvm-6589f7152e52a3f5901cb93e23acffc0158b5be9.zip
Change coalescer complexity from N^2 to N logN by changing one letter.
Remove ugly hack that aborted the coalescer before using N^2 time. This affects functions with very complicated live intervals for physical registers, i.e. functions with thousands of function calls. llvm-svn: 98776
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 5c621181cd9..2c1892de9c1 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -1682,20 +1682,9 @@ 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);
@@ -2170,7 +2159,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_, LHS,
+ li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, RHS,
li_->getVNInfoAllocator());
return true;
OpenPOWER on IntegriCloud