mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 891070 - IonMonkey: RangeAnalysis simplifications. r=nbp
This commit is contained in:
parent
611cee8e51
commit
fed7d5f0ff
@ -609,6 +609,9 @@ class MIRGraph
|
||||
ReversePostorderIterator rpoBegin() {
|
||||
return blocks_.begin();
|
||||
}
|
||||
ReversePostorderIterator rpoBegin(MBasicBlock *at) {
|
||||
return blocks_.begin(at);
|
||||
}
|
||||
ReversePostorderIterator rpoEnd() {
|
||||
return blocks_.end();
|
||||
}
|
||||
|
@ -1044,6 +1044,8 @@ RangeAnalysis::markBlocksInLoopBody(MBasicBlock *header, MBasicBlock *current)
|
||||
void
|
||||
RangeAnalysis::analyzeLoop(MBasicBlock *header)
|
||||
{
|
||||
JS_ASSERT(header->hasUniqueBackedge());
|
||||
|
||||
// Try to compute an upper bound on the number of times the loop backedge
|
||||
// will be taken. Look for tests that dominate the backedge and which have
|
||||
// an edge leaving the loop body.
|
||||
@ -1097,17 +1099,14 @@ RangeAnalysis::analyzeLoop(MBasicBlock *header)
|
||||
// Try to compute symbolic bounds for the phi nodes at the head of this
|
||||
// loop, expressed in terms of the iteration bound just computed.
|
||||
|
||||
for (MDefinitionIterator iter(header); iter; iter++) {
|
||||
MDefinition *def = *iter;
|
||||
if (def->isPhi())
|
||||
analyzeLoopPhi(header, iterationBound, def->toPhi());
|
||||
}
|
||||
for (MPhiIterator iter(header->phisBegin()); iter != header->phisEnd(); iter++)
|
||||
analyzeLoopPhi(header, iterationBound, *iter);
|
||||
|
||||
// Try to hoist any bounds checks from the loop using symbolic bounds.
|
||||
|
||||
Vector<MBoundsCheck *, 0, IonAllocPolicy> hoistedChecks;
|
||||
|
||||
for (ReversePostorderIterator iter(graph_.rpoBegin()); iter != graph_.rpoEnd(); iter++) {
|
||||
for (ReversePostorderIterator iter(graph_.rpoBegin(header)); iter != graph_.rpoEnd(); iter++) {
|
||||
MBasicBlock *block = *iter;
|
||||
if (!block->isMarked())
|
||||
continue;
|
||||
@ -1258,8 +1257,7 @@ RangeAnalysis::analyzeLoopPhi(MBasicBlock *header, LoopIterationBound *loopBound
|
||||
// but is required to change at most N and be either nondecreasing or
|
||||
// nonincreasing.
|
||||
|
||||
if (phi->numOperands() != 2)
|
||||
return;
|
||||
JS_ASSERT(phi->numOperands() == 2);
|
||||
|
||||
MBasicBlock *preLoop = header->loopPredecessor();
|
||||
JS_ASSERT(!preLoop->isMarked() && preLoop->successorWithPhis() == header);
|
||||
|
Loading…
Reference in New Issue
Block a user