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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 939113003: - Fix sin-cos merge, add a flag to turn it on/off. Using fsincos is much slower than calling out to… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « runtime/vm/disassembler_ia32.cc ('k') | runtime/vm/intermediate_language.cc » ('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 43881)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -33,6 +33,7 @@
DEFINE_FLAG(int, max_equality_polymorphic_checks, 32,
"Maximum number of polymorphic checks in equality operator,"
" otherwise use megamorphic dispatch.");
+DEFINE_FLAG(bool, merge_sin_cos, true, "Merge sin/cos into sincos");
DEFINE_FLAG(bool, trace_load_optimization, false,
"Print live sets for load optimization pass.");
DEFINE_FLAG(bool, trace_optimization, false, "Print optimization details.");
@@ -436,7 +437,8 @@
// Tries to merge MathUnary operations, in this case sinus and cosinus.
void FlowGraphOptimizer::TryMergeMathUnary(
GrowableArray<MathUnaryInstr*>* merge_candidates) {
- if (!FlowGraphCompiler::SupportsSinCos() || !CanUnboxDouble()) {
+ if (!FlowGraphCompiler::SupportsSinCos() || !CanUnboxDouble() ||
+ !FLAG_merge_sin_cos) {
return;
}
if (merge_candidates->length() < 2) {
@@ -453,8 +455,8 @@
ASSERT((kind == MathUnaryInstr::kSin) ||
(kind == MathUnaryInstr::kCos));
// Check if there is sin/cos binop with same inputs.
- const intptr_t other_kind = (kind == MethodRecognizer::kMathSin) ?
- MethodRecognizer::kMathCos : MethodRecognizer::kMathSin;
+ const intptr_t other_kind = (kind == MathUnaryInstr::kSin) ?
+ MathUnaryInstr::kCos : MathUnaryInstr::kSin;
Definition* def = curr_instr->value()->definition();
for (intptr_t k = i + 1; k < merge_candidates->length(); k++) {
MathUnaryInstr* other_op = (*merge_candidates)[k];
« no previous file with comments | « runtime/vm/disassembler_ia32.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698