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) { |