Chromium Code Reviews| Index: src/hydrogen-gvn.cc |
| diff --git a/src/hydrogen-gvn.cc b/src/hydrogen-gvn.cc |
| index 02b3a0a2c94dc217f625f78556cf1ab8cb0e95c1..1da477cf8413efc6f13c39075a2b104fb2e6052c 100644 |
| --- a/src/hydrogen-gvn.cc |
| +++ b/src/hydrogen-gvn.cc |
| @@ -412,10 +412,13 @@ void HGlobalValueNumberingPhase::ComputeBlockSideEffects() { |
| // Propagate loop side effects upwards. |
| if (block->HasParentLoopHeader()) { |
| - int header_id = block->parent_loop_header()->block_id(); |
| - loop_side_effects_[header_id].Add(block->IsLoopHeader() |
| - ? loop_side_effects_[id] |
| - : side_effects); |
| + HBasicBlock* with_parent = block; |
| + if (block->IsLoopHeader()) side_effects = loop_side_effects_[id]; |
| + while (with_parent->HasParentLoopHeader()) { |
| + HBasicBlock* parent_block = with_parent->parent_loop_header(); |
| + loop_side_effects_[parent_block->block_id()].Add(side_effects); |
| + with_parent = parent_block; |
| + } |
| } |
| } |
| } |
| @@ -567,7 +570,9 @@ void HGlobalValueNumberingPhase::ProcessLoopBlock( |
| } |
| if (inputs_loop_invariant && ShouldMove(instr, loop_header)) { |
| - TRACE_GVN_1("Hoisting loop invariant instruction %d\n", instr->id()); |
| + TRACE_GVN_3("Hoisting loop invariant instruction %d %d %s\n", |
|
titzer
2013/12/05 17:52:09
would like to see
"Hoisting loop invariant instru
|
| + instr->id(), pre_header->block_id(), |
| + *GetGVNFlagsString(loop_kills)); |
| // Move the instruction out of the loop. |
| instr->Unlink(); |
| instr->InsertBefore(pre_header->end()); |