Commit b8d367e5 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove no-out_of_bounds option from lower_switch

noone was using it anyway
parent 83856b6a
......@@ -70,12 +70,9 @@ FIRM_API void lower_CopyB(ir_graph *irg, unsigned max_small_size,
* @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.
......
......@@ -499,7 +499,7 @@ static void arm_lower_for_target(void)
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) {
......
......@@ -2054,7 +2054,7 @@ static void ia32_lower_for_target(void)
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);
......
......@@ -489,7 +489,7 @@ static void sparc_lower_for_target(void)
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);
......
......@@ -44,7 +44,6 @@
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;
......@@ -443,12 +442,10 @@ static void find_switch_nodes(ir_node *block, void *ctx)
|| (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;
}
......@@ -470,14 +467,12 @@ static void find_switch_nodes(ir_node *block, void *ctx)
| 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment