Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
b8d367e5
Commit
b8d367e5
authored
Oct 25, 2012
by
Matthias Braun
Browse files
remove no-out_of_bounds option from lower_switch
noone was using it anyway
parent
83856b6a
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/libfirm/lowering.h
View file @
b8d367e5
...
...
@@ -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.
...
...
ir/be/arm/bearch_arm.c
View file @
b8d367e5
...
...
@@ -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
)
{
...
...
ir/be/ia32/bearch_ia32.c
View file @
b8d367e5
...
...
@@ -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
);
...
...
ir/be/sparc/bearch_sparc.c
View file @
b8d367e5
...
...
@@ -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
);
...
...
ir/lower/lower_switch.c
View file @
b8d367e5
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment