projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d1aa8c9
)
local_optimize() now kills unrteachable code if dominance info is available.
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Wed, 12 Oct 2005 14:25:44 +0000
(14:25 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Wed, 12 Oct 2005 14:25:44 +0000
(14:25 +0000)
[r6687]
ir/ir/irgopt.c
patch
|
blob
|
history
diff --git
a/ir/ir/irgopt.c
b/ir/ir/irgopt.c
index
208b8f2
..
560d47e
100644
(file)
--- a/
ir/ir/irgopt.c
+++ b/
ir/ir/irgopt.c
@@
-92,6
+92,7
@@
optimize_in_place_wrapper (ir_node *n, void *env) {
static INLINE void do_local_optimize(ir_node *n) {
/* Handle graph state */
assert(get_irg_phase_state(current_ir_graph) != phase_building);
static INLINE void do_local_optimize(ir_node *n) {
/* Handle graph state */
assert(get_irg_phase_state(current_ir_graph) != phase_building);
+
if (get_opt_global_cse())
set_irg_pinned(current_ir_graph, op_pin_state_floats);
if (get_irg_outs_state(current_ir_graph) == outs_consistent)
if (get_opt_global_cse())
set_irg_pinned(current_ir_graph, op_pin_state_floats);
if (get_irg_outs_state(current_ir_graph) == outs_consistent)
@@
-100,7
+101,6
@@
static INLINE void do_local_optimize(ir_node *n) {
set_irg_dom_inconsistent(current_ir_graph);
set_irg_loopinfo_inconsistent(current_ir_graph);
set_irg_dom_inconsistent(current_ir_graph);
set_irg_loopinfo_inconsistent(current_ir_graph);
-
/* Clean the value_table in irg for the CSE. */
del_identities(current_ir_graph->value_table);
current_ir_graph->value_table = new_identities();
/* Clean the value_table in irg for the CSE. */
del_identities(current_ir_graph->value_table);
current_ir_graph->value_table = new_identities();
@@
-118,11
+118,23
@@
void local_optimize_node(ir_node *n) {
current_ir_graph = rem;
}
current_ir_graph = rem;
}
+/**
+ * Block-Walker: uses dominance depth to mark dead blocks.
+ */
+static void kill_dead_blocks(ir_node *block, void *env)
+{
+ if (get_Block_dom_depth(block) < 0)
+ set_Block_dead(block);
+}
+
void
local_optimize_graph (ir_graph *irg) {
ir_graph *rem = current_ir_graph;
current_ir_graph = irg;
void
local_optimize_graph (ir_graph *irg) {
ir_graph *rem = current_ir_graph;
current_ir_graph = irg;
+ if (get_irg_dom_state(current_ir_graph) == dom_consistent)
+ irg_block_walk_graph(irg, NULL, kill_dead_blocks, NULL);
+
do_local_optimize(irg->end);
current_ir_graph = rem;
do_local_optimize(irg->end);
current_ir_graph = rem;