| Index: src/arm/lithium-arm.cc
|
| diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
|
| index 93dc830dab30e3630bac62966133e5c35f3e8843..34cb1fcacc37cd9cb2e152c32e6b3ade77825e14 100644
|
| --- a/src/arm/lithium-arm.cc
|
| +++ b/src/arm/lithium-arm.cc
|
| @@ -1500,8 +1500,8 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) {
|
| return DefineAsRegister(mul);
|
|
|
| } else if (instr->representation().IsDouble()) {
|
| - if (instr->UseCount() == 1 && (instr->uses().value()->IsAdd() ||
|
| - instr->uses().value()->IsSub())) {
|
| + if (instr->HasOneUse() && (instr->uses().value()->IsAdd() ||
|
| + instr->uses().value()->IsSub())) {
|
| HBinaryOperation* use = HBinaryOperation::cast(instr->uses().value());
|
|
|
| if (use->IsAdd() && instr == use->left()) {
|
| @@ -1547,7 +1547,7 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) {
|
| }
|
| return result;
|
| } else if (instr->representation().IsDouble()) {
|
| - if (instr->right()->IsMul()) {
|
| + if (instr->right()->IsMul() && instr->right()->HasOneUse()) {
|
| return DoMultiplySub(instr->left(), HMul::cast(instr->right()));
|
| }
|
|
|
| @@ -1618,12 +1618,12 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
| LInstruction* result = DefineAsRegister(add);
|
| return result;
|
| } else if (instr->representation().IsDouble()) {
|
| - if (instr->left()->IsMul()) {
|
| + if (instr->left()->IsMul() && instr->left()->HasOneUse()) {
|
| return DoMultiplyAdd(HMul::cast(instr->left()), instr->right());
|
| }
|
|
|
| - if (instr->right()->IsMul()) {
|
| - ASSERT(!instr->left()->IsMul());
|
| + if (instr->right()->IsMul() && instr->right()->HasOneUse()) {
|
| + ASSERT(!instr->left()->IsMul() || !instr->left()->HasOneUse());
|
| return DoMultiplyAdd(HMul::cast(instr->right()), instr->left());
|
| }
|
|
|
|
|