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

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

Issue 108363003: We run phases in-between GVN and code motion, so we have to handle cases in the SsaCodeMotion phase… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 30948)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -1448,9 +1448,13 @@
}
if (!canBeMoved) continue;
- // This is safe because we are running after GVN.
- // TODO(ngeoffray): ensure GVN has been run.
- set_.add(current);
+ HInstruction existing = set_.lookup(current);
+ if (existing == null) {
+ set_.add(current);
+ } else {
+ block.rewriteWithBetterUser(current, existing);
+ block.remove(current);
+ }
}
}
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/inferrer/ir_type_inferrer.dart ('k') | tests/language/code_motion_crash_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698