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

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

Issue 2339853004: Avoid merging conditions across loop boundary (Closed)
Patch Set: Add test Created 4 years, 3 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: pkg/compiler/lib/src/ssa/codegen_helpers.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
index eda5485a70c8697b6bd64377fd949b59c64bb9d4..43515f8ddc84a5af5f597208127cd7812bafa174 100644
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -681,7 +681,8 @@ class SsaConditionMerger extends HGraphVisitor {
// A [HIs] instruction uses its input multiple times, so we
// avoid generating it at use site.
if (user is HIs) return false;
- return true;
+ // Avoid code motion into a loop.
+ return user.hasSameLoopHeaderAs(input);
}
void visitBasicBlock(HBasicBlock block) {
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/27354_test.dart » ('j') | tests/compiler/dart2js_extra/27354_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698