aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadbackward.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-threadbackward.c')
-rw-r--r--gcc/tree-ssa-threadbackward.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c
index 8424954..74b5f36 100644
--- a/gcc/tree-ssa-threadbackward.c
+++ b/gcc/tree-ssa-threadbackward.c
@@ -89,6 +89,7 @@ private:
void find_paths (basic_block bb, tree name);
bool debug_counter ();
edge maybe_register_path ();
+ void maybe_register_path_dump (edge taken_edge);
void find_paths_to_names (basic_block bb, bitmap imports);
bool resolve_def (tree name, bitmap interesting, vec<tree> &worklist);
void resolve_phi (gphi *phi, bitmap imports);
@@ -186,6 +187,35 @@ back_threader::debug_counter ()
return true;
}
+// Dump details of an attempt to register a path.
+
+void
+back_threader::maybe_register_path_dump (edge taken)
+{
+ if (m_path.is_empty ())
+ return;
+
+ fprintf (dump_file, "path: ");
+
+ for (unsigned i = m_path.length (); i > 0; --i)
+ {
+ basic_block bb = m_path[i - 1];
+ fprintf (dump_file, "%d", bb->index);
+ if (i > 1)
+ fprintf (dump_file, "->");
+ }
+ fprintf (dump_file, "->");
+
+ if (taken == UNREACHABLE_EDGE)
+ fprintf (dump_file, "xx REJECTED (unreachable)\n");
+ else if (taken)
+ fprintf (dump_file, "%d SUCCESS\n", taken->dest->index);
+ else
+ fprintf (dump_file, "xx REJECTED\n");
+}
+
+// If an outgoing edge can be determined out of the current path,
+// register it for jump threading and return the taken edge.
//
// Return NULL if it is unprofitable to thread this path, or the
// outgoing edge is unknown. Return UNREACHABLE_EDGE if the path is
@@ -220,6 +250,10 @@ back_threader::maybe_register_path ()
taken_edge = NULL;
}
}
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ maybe_register_path_dump (taken_edge);
+
return taken_edge;
}