Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
3bb47464
Commit
3bb47464
authored
Sep 16, 2011
by
Matthias Braun
Browse files
remove loopinfo stuff and exclusively use IR_GRAPH_STATE_CONSISTENT_LOOPINFO
parent
4ebb78a2
Changes
24
Hide whitespace changes
Inline
Side-by-side
ir/opt/opt_inline.c
View file @
3bb47464
...
...
@@ -989,7 +989,7 @@ void inline_leave_functions(unsigned maxsize, unsigned leavesize,
assert
(
get_irg_phase_state
(
irg
)
!=
phase_building
);
free_callee_info
(
irg
);
assure_
cf_
loop
(
irg
);
assure_loop
info
(
irg
);
wenv
.
x
=
(
inline_irg_env
*
)
get_irg_link
(
irg
);
irg_walk_graph
(
irg
,
NULL
,
collect_calls2
,
&
wenv
);
}
...
...
@@ -1116,7 +1116,7 @@ void inline_leave_functions(unsigned maxsize, unsigned leavesize,
callee_env
=
alloc_inline_irg_env
();
set_irg_link
(
copy
,
callee_env
);
assure_
cf_
loop
(
copy
);
assure_loop
info
(
copy
);
wenv
.
x
=
callee_env
;
wenv
.
ignore_callers
=
1
;
irg_walk_graph
(
copy
,
NULL
,
collect_calls2
,
&
wenv
);
...
...
@@ -1652,7 +1652,7 @@ static void inline_into(ir_graph *irg, unsigned maxsize,
callee_env
=
alloc_inline_irg_env
();
set_irg_link
(
copy
,
callee_env
);
assure_
cf_
loop
(
copy
);
assure_loop
info
(
copy
);
memset
(
&
wenv
,
0
,
sizeof
(
wenv
));
wenv
.
x
=
callee_env
;
wenv
.
ignore_callers
=
1
;
...
...
@@ -1764,7 +1764,7 @@ void inline_functions(unsigned maxsize, int inline_threshold,
free_callee_info
(
irg
);
wenv
.
x
=
(
inline_irg_env
*
)
get_irg_link
(
irg
);
assure_
cf_
loop
(
irg
);
assure_loop
info
(
irg
);
irg_walk_graph
(
irg
,
NULL
,
collect_calls2
,
&
wenv
);
}
...
...
ir/opt/opt_manage.c
View file @
3bb47464
...
...
@@ -25,11 +25,6 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
ir_graph_state_t
required
=
opt
->
requirements
;
const
bool
dump
=
get_irp_optimization_dumps
();
/** Some workarounds because information is currently duplicated */
// FIXME should not be necessary!
if
(
loopinfo_inconsistent
==
get_irg_loopinfo_state
(
irg
))
clear_irg_state
(
irg
,
IR_GRAPH_STATE_CONSISTENT_LOOPINFO
);
/* assure that all requirements for the optimization are fulfilled */
#define PREPARE(st,func) if (st & (required ^ irg->state)) {func(irg); set_irg_state(irg,st);}
PREPARE
(
IR_GRAPH_STATE_ONE_RETURN
,
normalize_one_return
)
...
...
@@ -40,7 +35,7 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
PREPARE
(
IR_GRAPH_STATE_CONSISTENT_POSTDOMINANCE
,
assure_postdoms
)
PREPARE
(
IR_GRAPH_STATE_CONSISTENT_OUT_EDGES
,
edges_assure
)
PREPARE
(
IR_GRAPH_STATE_CONSISTENT_OUTS
,
assure_irg_outs
)
PREPARE
(
IR_GRAPH_STATE_CONSISTENT_LOOPINFO
,
assure_
cf_
loop
)
PREPARE
(
IR_GRAPH_STATE_CONSISTENT_LOOPINFO
,
assure_loop
info
)
PREPARE
(
IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE
,
assure_irg_entity_usage_computed
)
PREPARE
(
IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS
,
compute_extbb
)
...
...
@@ -66,7 +61,7 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
INVALIDATE
(
IR_GRAPH_STATE_CONSISTENT_POSTDOMINANCE
,
nop
)
INVALIDATE
(
IR_GRAPH_STATE_CONSISTENT_OUTS
,
nop
)
INVALIDATE
(
IR_GRAPH_STATE_CONSISTENT_OUT_EDGES
,
edges_deactivate
)
INVALIDATE
(
IR_GRAPH_STATE_CONSISTENT_LOOPINFO
,
set_irg_loopinfo_inconsistent
)
INVALIDATE
(
IR_GRAPH_STATE_CONSISTENT_LOOPINFO
,
nop
)
INVALIDATE
(
IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE
,
nop
)
INVALIDATE
(
IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS
,
set_irg_extblk_inconsistent
)
...
...
ir/opt/reassoc.c
View file @
3bb47464
...
...
@@ -925,7 +925,6 @@ static void reverse_rules(ir_node *node, void *env)
int
optimize_reassociation
(
ir_graph
*
irg
)
{
walker_t
env
;
irg_loopinfo_state
state
;
assert
(
get_irg_phase_state
(
irg
)
!=
phase_building
);
assert
(
get_irg_pinned
(
irg
)
!=
op_pin_state_floats
&&
...
...
@@ -942,13 +941,8 @@ int optimize_reassociation(ir_graph *irg)
/*
* Calculate loop info, so we could identify loop-invariant
* code and treat it like a constant.
* We only need control flow loops here but can handle generic
* INTRA info as well.
*/
state
=
get_irg_loopinfo_state
(
irg
);
if
((
state
&
loopinfo_inter
)
||
(
state
&
(
loopinfo_constructed
|
loopinfo_valid
))
!=
(
loopinfo_constructed
|
loopinfo_valid
))
construct_cf_backedges
(
irg
);
assure_loopinfo
(
irg
);
env
.
changes
=
0
;
env
.
irg
=
irg
;
...
...
ir/opt/tailrec.c
View file @
3bb47464
...
...
@@ -265,9 +265,9 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
}
/* tail recursion was done, all info is invalid */
clear_irg_state
(
irg
,
IR_GRAPH_STATE_CONSISTENT_DOMINANCE
);
clear_irg_state
(
irg
,
IR_GRAPH_STATE_CONSISTENT_DOMINANCE
|
IR_GRAPH_STATE_CONSISTENT_LOOPINFO
);
set_irg_extblk_inconsistent
(
irg
);
set_irg_loopinfo_state
(
irg
,
loopinfo_cf_inconsistent
);
set_trouts_inconsistent
();
set_irg_callee_info_state
(
irg
,
irg_callee_info_inconsistent
);
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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