| Index: runtime/vm/constant_propagator.cc
|
| diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc
|
| index 4409f3f274b783e9ed8cd91aa6babce1423402cb..6b97f7d20ce31f99b881c248d284f9334f42d15e 100644
|
| --- a/runtime/vm/constant_propagator.cc
|
| +++ b/runtime/vm/constant_propagator.cc
|
| @@ -1514,8 +1514,9 @@ void ConstantPropagator::EliminateRedundantBranches() {
|
|
|
| changed = true;
|
|
|
| - if (FLAG_trace_constant_propagation) {
|
| - OS::Print("Eliminated branch in B%" Pd " common target B%" Pd "\n",
|
| + if (FLAG_trace_constant_propagation &&
|
| + FlowGraphPrinter::ShouldPrint(graph_->function())) {
|
| + THR_Print("Eliminated branch in B%" Pd " common target B%" Pd "\n",
|
| block->block_id(), join->block_id());
|
| }
|
| }
|
| @@ -1533,7 +1534,8 @@ void ConstantPropagator::EliminateRedundantBranches() {
|
|
|
|
|
| void ConstantPropagator::Transform() {
|
| - if (FLAG_trace_constant_propagation) {
|
| + if (FLAG_trace_constant_propagation &&
|
| + FlowGraphPrinter::ShouldPrint(graph_->function())) {
|
| FlowGraphPrinter::PrintGraph("Before CP", graph_);
|
| }
|
|
|
| @@ -1546,8 +1548,9 @@ void ConstantPropagator::Transform() {
|
| b.Advance()) {
|
| BlockEntryInstr* block = b.Current();
|
| if (!reachable_->Contains(block->preorder_number())) {
|
| - if (FLAG_trace_constant_propagation) {
|
| - OS::Print("Unreachable B%" Pd "\n", block->block_id());
|
| + if (FLAG_trace_constant_propagation &&
|
| + FlowGraphPrinter::ShouldPrint(graph_->function())) {
|
| + THR_Print("Unreachable B%" Pd "\n", block->block_id());
|
| }
|
| // Remove all uses in unreachable blocks.
|
| block->ClearAllInstructions();
|
| @@ -1618,8 +1621,9 @@ void ConstantPropagator::Transform() {
|
| !defn->IsStoreIndexed() &&
|
| !defn->IsStoreInstanceField() &&
|
| !defn->IsStoreStaticField()) {
|
| - if (FLAG_trace_constant_propagation) {
|
| - OS::Print("Constant v%" Pd " = %s\n",
|
| + if (FLAG_trace_constant_propagation &&
|
| + FlowGraphPrinter::ShouldPrint(graph_->function())) {
|
| + THR_Print("Constant v%" Pd " = %s\n",
|
| defn->ssa_temp_index(),
|
| defn->constant_value().ToCString());
|
| }
|
| @@ -1681,7 +1685,8 @@ void ConstantPropagator::Transform() {
|
| GrowableArray<BitVector*> dominance_frontier;
|
| graph_->ComputeDominators(&dominance_frontier);
|
|
|
| - if (FLAG_trace_constant_propagation) {
|
| + if (FLAG_trace_constant_propagation &&
|
| + FlowGraphPrinter::ShouldPrint(graph_->function())) {
|
| FlowGraphPrinter::PrintGraph("After CP", graph_);
|
| }
|
| }
|
|
|