| Index: lib/compiler/implementation/ssa/optimize.dart
|
| ===================================================================
|
| --- lib/compiler/implementation/ssa/optimize.dart (revision 14336)
|
| +++ lib/compiler/implementation/ssa/optimize.dart (working copy)
|
| @@ -890,9 +890,13 @@
|
| if (block.isLoopHeader()) {
|
| int changesFlags = loopChangesFlags[block.id];
|
| HLoopInformation info = block.loopInformation;
|
| - HBasicBlock last = info.getLastBackEdge();
|
| - for (int j = block.id; j <= last.id; j++) {
|
| - moveLoopInvariantCodeFromBlock(graph.blocks[j], block, changesFlags);
|
| + // Iterate over all blocks of this loop. Note that blocks in
|
| + // inner loops are not visited here, but we know they
|
| + // were visited before because we are iterating in post-order.
|
| + // So instructions that are GVN'ed in an inner loop are in their
|
| + // loop header, and [info.blocks] contains this loop header.
|
| + for (HBasicBlock other in info.blocks) {
|
| + moveLoopInvariantCodeFromBlock(other, block, changesFlags);
|
| }
|
| }
|
| }
|
|
|