* @param small_switch If switch has <= cases then change it to an if-cascade.
* @param spare_size Allowed spare size for table switches in machine words.
* (Default in edgfe: 128)
- * @param allow_out_of_bounds backend can handle out-of-bounds values
- * (values bigger than minimum and maximum proj
- * number)
*/
FIRM_API void lower_switch(ir_graph *irg, unsigned small_switch,
- unsigned spare_size, int allow_out_of_bounds);
+ unsigned spare_size);
/**
* Replaces SymConsts by a real constant if possible.
for (i = 0; i < n_irgs; ++i) {
ir_graph *irg = get_irp_irg(i);
- lower_switch(irg, 4, 256, false);
+ lower_switch(irg, 4, 256);
}
for (i = 0; i < n_irgs; ++i) {
for (i = 0; i < n_irgs; ++i) {
ir_graph *irg = get_irp_irg(i);
/* break up switches with wide ranges */
- lower_switch(irg, 4, 256, false);
+ lower_switch(irg, 4, 256);
}
ir_prepare_dw_lowering(&lower_dw_params);
for (i = 0; i < n_irgs; ++i) {
ir_graph *irg = get_irp_irg(i);
ir_lower_mode_b(irg, mode_Iu);
- lower_switch(irg, 4, 256, false);
+ lower_switch(irg, 4, 256);
/* TODO: Pass SPARC_MIN_STACKSIZE as addr_delta as soon as
* Alloc nodes are implemented more efficiently. */
lower_alloc(irg, SPARC_STACK_ALIGNMENT, true, 0);
typedef struct walk_env_t {
unsigned spare_size; /**< the allowed spare size for table switches */
unsigned small_switch;
- bool allow_out_of_bounds;
bool changed; /**< indicates whether a change was performed */
ir_nodeset_t processed;
} walk_env_t;
|| (tarval_cmp(spare, spare_size) & ir_relation_greater_equal));
if (!lower_switch) {
- /* we won't decompose the switch. But we might have to add
- * out-of-bounds checking */
- if (!env->allow_out_of_bounds) {
- normalize_switch(&info);
- create_out_of_bounds_check(&info);
- }
+ /* we won't decompose the switch. But we must add an out-of-bounds
+ * check */
+ normalize_switch(&info);
+ create_out_of_bounds_check(&info);
return;
}
| IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
}
-void lower_switch(ir_graph *irg, unsigned small_switch, unsigned spare_size,
- int allow_out_of_bounds)
+void lower_switch(ir_graph *irg, unsigned small_switch, unsigned spare_size)
{
walk_env_t env;
env.changed = false;
env.spare_size = spare_size;
env.small_switch = small_switch;
- env.allow_out_of_bounds = allow_out_of_bounds;
ir_nodeset_init(&env.processed);
remove_critical_cf_edges(irg);