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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 135553005: Fix issue 16592: Do not attempt to merge operations that do not have uses, otherwise we add force u… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 32376)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -354,10 +354,12 @@
(other_binop->right()->definition() == right_def)) {
(*merge_candidates)[k] = NULL; // Clear it.
// Append a LoadIndexed behind TRUNC_DIV and MOD.
+ ASSERT(curr_instr->HasUses());
AppendLoadIndexedForMerged(
curr_instr,
MergedMathInstr::ResultIndexOf(curr_instr->op_kind()),
kArrayCid);
+ ASSERT(other_binop->HasUses());
AppendLoadIndexedForMerged(
other_binop,
MergedMathInstr::ResultIndexOf(other_binop->op_kind()),
@@ -414,10 +416,12 @@
(other_op->value()->definition() == def)) {
(*merge_candidates)[k] = NULL; // Clear it.
// Append a LoadIndexed behind SIN and COS.
+ ASSERT(curr_instr->HasUses());
AppendLoadIndexedForMerged(
curr_instr,
MergedMathInstr::ResultIndexOf(curr_instr->kind()),
kTypedDataFloat64ArrayCid);
+ ASSERT(other_op->HasUses());
AppendLoadIndexedForMerged(
other_op,
MergedMathInstr::ResultIndexOf(other_op->kind()),
@@ -467,7 +471,9 @@
binop->right()->definition());
} else if ((binop->op_kind() == Token::kTRUNCDIV) ||
(binop->op_kind() == Token::kMOD)) {
- div_mod_merge.Add(binop);
+ if (binop->HasUses()) {
+ div_mod_merge.Add(binop);
+ }
}
} else if (it.Current()->IsBinaryMintOp()) {
BinaryMintOpInstr* mintop = it.Current()->AsBinaryMintOp();
@@ -480,7 +486,9 @@
MathUnaryInstr* math_unary = it.Current()->AsMathUnary();
if ((math_unary->kind() == MethodRecognizer::kMathSin) ||
(math_unary->kind() == MethodRecognizer::kMathCos)) {
- sin_cos_merge.Add(math_unary);
+ if (math_unary->HasUses()) {
+ sin_cos_merge.Add(math_unary);
+ }
}
}
}
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698