@item evrp-mode
Specifies the mode Early VRP should operate in.
+@item evrp-switch-limit
+Specifies the maximum number of switch cases before EVRP ignores a switch.
+
@item unroll-jam-min-percent
The minimum percentage of memory references that must be optimized
away for the unroll-and-jam transformation to be considered profitable.
}
-gimple_outgoing_range::gimple_outgoing_range ()
+gimple_outgoing_range::gimple_outgoing_range (int max_sw_edges)
{
m_edge_table = NULL;
+ m_max_edges = max_sw_edges;
}
return s;
}
+ // Only process switches if it within the size limit.
+ if (EDGE_COUNT (e->src->succs) > (unsigned)m_max_edges)
+ return NULL;
+
gcc_checking_assert (is_a<gswitch *> (s));
gswitch *sw = as_a<gswitch *> (s);
tree type = TREE_TYPE (gimple_switch_index (sw));
class gimple_outgoing_range
{
public:
- gimple_outgoing_range ();
+ gimple_outgoing_range (int max_sw_edges = INT_MAX);
~gimple_outgoing_range ();
gimple *edge_range_p (irange &r, edge e);
private:
void calc_switch_ranges (gswitch *sw);
bool get_edge_range (irange &r, gimple *s, edge e);
+ int m_max_edges;
hash_map<edge, irange *> *m_edge_table;
irange_allocator m_range_allocator;
};
}
else
{
+ // Do not process switches if they are too large.
+ if (EDGE_COUNT (bb->succs) > (unsigned)param_evrp_switch_limit)
+ return;
gswitch *gs = as_a<gswitch *>(stmt);
name = gimple_range_ssa_p (gimple_switch_index (gs));
maybe_add_gori (name, gimple_bb (stmt));
// Construct a gori_compute object.
-gori_compute::gori_compute (int not_executable_flag) : tracer ("GORI ")
+gori_compute::gori_compute (int not_executable_flag)
+ : outgoing (param_evrp_switch_limit), tracer ("GORI ")
{
m_not_executable_flag = not_executable_flag;
// Create a boolean_type true and false range.
Common Joined UInteger Var(param_evrp_sparse_threshold) Init(800) Optimization Param
Maximum number of basic blocks before EVRP uses a sparse cache.
+-param=evrp-switch-limit=
+Common Joined UInteger Var(param_evrp_switch_limit) Init(50) Optimization Param
+Maximum number of outgoing edges in a switch before EVRP will not process it.
+
-param=evrp-mode=
Common Joined Var(param_evrp_mode) Enum(evrp_mode) Init(EVRP_MODE_RVRP_ONLY) Param Optimization
--param=evrp-mode=[legacy|ranger|legacy-first|ranger-first|trace|gori|cache|tracegori|debug] Specifies the mode Early VRP should operate in.