Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10831404: When replacing an instruction with another in GVN-like optimizations, try to find a better user of … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698