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
2f448650
Commit
2f448650
authored
Jun 15, 2012
by
Matthias Braun
Browse files
cfopt: code cleanup
parent
7cf06579
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/cfopt.c
View file @
2f448650
...
...
@@ -849,26 +849,13 @@ static ir_graph_properties_t do_cfopt(ir_graph *irg)
ir_reserve_resources
(
irg
,
IR_RESOURCE_BLOCK_MARK
|
IR_RESOURCE_IRN_LINK
|
IR_RESOURCE_PHI_LIST
);
/* The switch Cond optimization might expose unreachable code, so we loop */
for
(;;)
{
bool
changed
=
false
;
assure_doms
(
irg
);
/*
* This pass collects all Phi nodes in a link list in the block
* nodes. Further it performs simple control flow optimizations.
* Finally it marks all blocks that do not contain useful
* computations, i.e., these blocks might be removed.
*/
irg_walk
(
end
,
clear_link_and_mark_blocks_removable
,
collect_nodes
,
NULL
);
if
(
!
changed
)
break
;
clear_irg_properties
(
irg
,
IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE
|
IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE
);
}
/*
* This pass collects all Phi nodes in a link list in the block
* nodes. Further it performs simple control flow optimizations.
* Finally it marks all blocks that do not contain useful
* computations, i.e., these blocks might be removed.
*/
irg_walk
(
end
,
clear_link_and_mark_blocks_removable
,
collect_nodes
,
NULL
);
/* assert due to collect_nodes:
* 1. removable blocks are now marked as such
...
...
@@ -876,9 +863,9 @@ static ir_graph_properties_t do_cfopt(ir_graph *irg)
*/
/* Optimize the standard code.
* It walks only over block nodes and adapts these and the Phi nodes in
these
* blocks, which it finds in a linked list computed before.
*
*/
* It walks only over block nodes and adapts these and the Phi nodes in
*
these
blocks, which it finds in a linked list computed before.
*/
assure_doms
(
irg
);
irg_block_walk_graph
(
irg
,
optimize_blocks
,
merge_blocks
,
&
env
);
...
...
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