Maximum number of statements allowed in a block that needs to be
duplicated when threading jumps.
+@item max-jump-thread-paths
+The maximum number of paths to consider when searching for jump threading
+opportunities. When arriving at a block incoming edges are only considered
+if the number of paths to be searched sofar multiplied by the incoming
+edge degree does not exhaust the specified maximum number of paths to
+consider.
+
@item max-fields-for-field-sensitive
Maximum number of fields in a structure treated in
a field sensitive manner during pointer analysis.
Common Joined UInteger Var(param_max_jump_thread_duplication_stmts) Init(15) Param Optimization
Maximum number of statements allowed in a block that needs to be duplicated when threading jumps.
+-param=max-jump-thread-paths=
+Common Joined UInteger Var(param_max_jump_thread_paths) Init(64) IntegerRange(1, 65536) Param Optimization
+Search space limit for the backwards jump threader.
+
-param=max-last-value-rtl=
Common Joined UInteger Var(param_max_last_value_rtl) Init(10000) Param Optimization
The maximum number of RTL nodes that can be recorded as combiner's last value.
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);
+ void find_paths_to_names (basic_block bb, bitmap imports, unsigned);
edge find_taken_edge (const vec<basic_block> &path);
edge find_taken_edge_cond (const vec<basic_block> &path, gcond *);
edge find_taken_edge_switch (const vec<basic_block> &path, gswitch *);
// INTERESTING bitmap, and register any such paths.
//
// BB is the current path being processed.
+//
+// OVERALL_PATHS is the search space up to this block
void
-back_threader::find_paths_to_names (basic_block bb, bitmap interesting)
+back_threader::find_paths_to_names (basic_block bb, bitmap interesting,
+ unsigned overall_paths)
{
if (m_visited_bbs.add (bb))
return;
|| maybe_register_path ()))
;
- // Continue looking for ways to extend the path
- else
+ // Continue looking for ways to extend the path but limit the
+ // search space along a branch
+ else if ((overall_paths = overall_paths * EDGE_COUNT (bb->preds))
+ <= (unsigned)param_max_jump_thread_paths)
{
// For further greedy searching we want to remove interesting
// names defined in BB but add ones on the PHI edges for the
unwind.quick_push (def);
}
}
- find_paths_to_names (e->src, new_interesting);
+ find_paths_to_names (e->src, new_interesting, overall_paths);
// Restore new_interesting. We leave m_imports alone since
// we do not prune defs in BB from it and separately keeping
// track of which bits to unwind isn't worth the trouble.
}
}
}
+ else if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " FAIL: Search space limit %d reached.\n",
+ param_max_jump_thread_paths);
// Reset things to their original state.
m_path.pop ();
auto_bitmap interesting;
bitmap_copy (interesting, m_imports);
- find_paths_to_names (bb, interesting);
+ find_paths_to_names (bb, interesting, 1);
}
}