mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 870095 - Prefer clobbering binary operands with no further uses. r=h4writer
This commit is contained in:
parent
7dea1ba01d
commit
af63beda97
@ -858,8 +858,10 @@ ReorderCommutative(MDefinition **lhsp, MDefinition **rhsp)
|
||||
MDefinition *lhs = *lhsp;
|
||||
MDefinition *rhs = *rhsp;
|
||||
|
||||
// Put the constant in the right-hand side, if there is one.
|
||||
if (lhs->isConstant()) {
|
||||
// Ensure that if there is a constant, then it is in rhs.
|
||||
// In addition, since clobbering binary operations clobber the left
|
||||
// operand, prefer a lhs operand with no further uses.
|
||||
if (lhs->isConstant() || rhs->useCount() == 1) {
|
||||
*rhsp = lhs;
|
||||
*lhsp = rhs;
|
||||
}
|
||||
@ -1156,6 +1158,7 @@ LIRGenerator::visitAdd(MAdd *ins)
|
||||
|
||||
if (ins->specialization() == MIRType_Double) {
|
||||
JS_ASSERT(lhs->type() == MIRType_Double);
|
||||
ReorderCommutative(&lhs, &rhs);
|
||||
return lowerForFPU(new LMathD(JSOP_ADD), ins, lhs, rhs);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user