| Index: lib/compiler/implementation/ssa/optimize.dart
|
| ===================================================================
|
| --- lib/compiler/implementation/ssa/optimize.dart (revision 11018)
|
| +++ lib/compiler/implementation/ssa/optimize.dart (working copy)
|
| @@ -42,6 +42,9 @@
|
| new SsaDeadPhiEliminator(),
|
| new SsaGlobalValueNumberer(compiler, types),
|
| new SsaCodeMotion(),
|
| + // Previous optimizations may have generated new
|
| + // opportunities for constant folding.
|
| + new SsaConstantFolder(backend, work, types),
|
| new SsaDeadCodeEliminator(types),
|
| new SsaRegisterRecompilationCandidates(backend, work, types)];
|
| runPhases(graph, phases);
|
| @@ -930,7 +933,7 @@
|
| HInstruction other = values.lookup(instruction);
|
| if (other !== null) {
|
| assert(other.gvnEquals(instruction) && instruction.gvnEquals(other));
|
| - block.rewrite(instruction, other);
|
| + block.rewriteWithBetterUser(instruction, other);
|
| block.remove(instruction);
|
| } else {
|
| values.add(instruction);
|
| @@ -1072,7 +1075,7 @@
|
| for (final successor in successors) {
|
| HInstruction toRewrite = values[successor.id].lookup(instruction);
|
| if (toRewrite != instruction) {
|
| - successor.rewrite(toRewrite, instruction);
|
| + successor.rewriteWithBetterUser(toRewrite, instruction);
|
| successor.remove(toRewrite);
|
| }
|
| }
|
|
|