no bug: Fix the spew that was messed up in a merge, and refactor control flow a bit (r=sunfish)

This commit is contained in:
Marty Rosenberg 2014-07-15 03:34:07 -04:00
parent 65e17ddeb1
commit 2c8d256592

View File

@ -776,27 +776,26 @@ BacktrackingAllocator::tryAllocateRegister(PhysicalRegister &r, LiveInterval *in
AllocatedRange range(interval, interval->getRange(i)), existing;
for (size_t a = 0; a < r.reg.numAliased(); a++) {
PhysicalRegister &rAlias = registers[r.reg.aliased(a).code()];
if (rAlias.allocations.contains(range, &existing)) {
if (existing.interval->hasVreg()) {
if (IonSpewEnabled(IonSpew_RegAlloc)) {
if (!rAlias.allocations.contains(range, &existing))
continue;
if (existing.interval->hasVreg()) {
if (IonSpewEnabled(IonSpew_RegAlloc)) {
IonSpew(IonSpew_RegAlloc, " %s collides with v%u[%u] %s [weight %lu]",
rAlias.reg.name(), existing.interval->vreg(),
existing.interval->index(),
existing.range->toString(),
rAlias.reg.name(), existing.interval->vreg(),
existing.interval->index(),
existing.range->toString(),
computeSpillWeight(existing.interval));
}
if (!*pconflicting || computeSpillWeight(existing.interval) < computeSpillWeight(*pconflicting))
*pconflicting = existing.interval;
} else {
if (IonSpewEnabled(IonSpew_RegAlloc)) {
IonSpew(IonSpew_RegAlloc, " %s collides with fixed use %s",
rAlias.reg.name(), existing.range->toString());
}
*pfixed = true;
computeSpillWeight(existing.interval));
}
return true;
if (!*pconflicting || computeSpillWeight(existing.interval) < computeSpillWeight(*pconflicting))
*pconflicting = existing.interval;
} else {
if (IonSpewEnabled(IonSpew_RegAlloc)) {
IonSpew(IonSpew_RegAlloc, " %s collides with fixed use %s",
rAlias.reg.name(), existing.range->toString());
}
*pfixed = true;
}
return true;
}
}