Bug 1169460 - Fix imprecise computation in BacktrackingAllocator::minimalUse, r=sunfish.

This commit is contained in:
Brian Hackett 2015-06-06 09:03:59 -07:00
Родитель d8454f0a42
Коммит 4ccefce630
2 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -2326,11 +2326,12 @@ BacktrackingAllocator::minimalDef(LiveRange* range, LNode* ins)
}
bool
BacktrackingAllocator::minimalUse(LiveRange* range, LNode* ins)
BacktrackingAllocator::minimalUse(LiveRange* range, UsePosition* use)
{
// Whether this is a minimal range capturing a use at ins.
// Whether this is a minimal range capturing |use|.
LNode* ins = insData[use->pos];
return (range->from() == inputOf(ins)) &&
(range->to() == outputOf(ins) || range->to() == outputOf(ins).next());
(range->to() == (use->use->usedAtStart() ? outputOf(ins) : outputOf(ins).next()));
}
bool
@ -2368,12 +2369,12 @@ BacktrackingAllocator::minimalBundle(LiveBundle* bundle, bool* pfixed)
if (fixed)
return false;
fixed = true;
if (minimalUse(range, insData[iter->pos]))
if (minimalUse(range, *iter))
minimal = true;
break;
case LUse::REGISTER:
if (minimalUse(range, insData[iter->pos]))
if (minimalUse(range, *iter))
minimal = true;
break;

Просмотреть файл

@ -707,7 +707,7 @@ class BacktrackingAllocator : protected RegisterAllocator
struct PrintLiveRange;
bool minimalDef(LiveRange* range, LNode* ins);
bool minimalUse(LiveRange* range, LNode* ins);
bool minimalUse(LiveRange* range, UsePosition* use);
bool minimalBundle(LiveBundle* bundle, bool* pfixed = nullptr);
// Heuristic methods.