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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1914623002: Fix for issue 26243 - illegal motion of assignments in instruction merging (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/compiler/lib/src/ssa/types_propagation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 7d01871e1befa0753253491e701a2bc977c196fb..a4ee03951d52a675688e9ffe70fc261d91960935 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -247,14 +247,9 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction visitParameterValue(HParameterValue node) {
- // It is possible for the parameter value to be assigned to in the function
- // body. If that happens then we should not forward the constant value to
- // its uses since since the uses reachable from the assignment may have
- // values in addition to the constant passed to the function.
- if (node.usedBy
- .any((user) => user is HLocalSet && identical(user.local, node))) {
- return node;
- }
+ // If the parameter is used as a mutable variable we cannot replace the
+ // variable with a value.
+ if (node.usedAsVariable()) return node;
propagateConstantValueToUses(node);
return node;
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/compiler/lib/src/ssa/types_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698