Bug 855965 - Symbolic range analysis transfers range analysis bounds to phis. r=mjrosenb

This commit is contained in:
Nicolas B. Pierron 2013-03-29 13:25:23 -07:00
parent c739458274
commit d88a324520

View File

@ -1038,10 +1038,15 @@ RangeAnalysis::analyzeLoopPhi(MBasicBlock *header, LoopIterationBound *loopBound
if (!SafeSub(0, modified.constant, &negativeConstant) || !limitSum.add(negativeConstant))
return;
Range *initRange = initial->range();
if (modified.constant > 0) {
if (initRange && !initRange->isLowerInfinite())
phi->range()->setLower(initRange->lower());
phi->range()->setSymbolicLower(new SymbolicBound(NULL, initialSum));
phi->range()->setSymbolicUpper(new SymbolicBound(loopBound, limitSum));
} else {
if (initRange && !initRange->isUpperInfinite())
phi->range()->setUpper(initRange->upper());
phi->range()->setSymbolicUpper(new SymbolicBound(NULL, initialSum));
phi->range()->setSymbolicLower(new SymbolicBound(loopBound, limitSum));
}