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
6e7441e9
Commit
6e7441e9
authored
Jan 30, 2015
by
Christoph Mallon
Browse files
combo: Do not set flags for unreachable blocks, which nobody reads anymore anyway.
parent
2da74da1
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/combo.c
View file @
6e7441e9
...
...
@@ -2764,28 +2764,14 @@ static void apply_cf(ir_node *block, void *ctx)
int
n
=
get_Block_n_cfgpreds
(
block
);
if
(
!
is_reachable
(
node
))
{
env
->
modified
=
true
;
for
(
int
i
=
n
;
i
--
>
0
;
)
{
ir_node
*
pred
=
get_Block_cfgpred
(
block
,
i
);
if
(
!
is_Bad
(
pred
))
{
ir_node
*
pred_block
=
get_nodes_block
(
skip_Proj
(
pred
));
if
(
!
is_Bad
(
pred_block
))
{
node_t
*
pred_bl
=
get_irn_node
(
pred_block
);
if
(
pred_bl
->
flagged
==
0
)
{
pred_bl
->
flagged
=
3
;
}
}
}
}
/* Nothing to do for unreachable blocks. Their control-flow successors cut
* them off anyway. The only exception is the end block. */
ir_graph
*
const
irg
=
get_irn_irg
(
block
);
if
(
block
==
get_irg_end_block
(
irg
))
{
/* Analysis found out that the end block is unreachable,
* hence we remove all its control flow predecessors. */
set_irn_in
(
block
,
0
,
NULL
);
env
->
modified
=
true
;
}
return
;
}
...
...
@@ -2815,16 +2801,6 @@ static void apply_cf(ir_node *block, void *ctx)
in_X
[
k
++
]
=
pred
;
}
else
{
DB
((
dbg
,
LEVEL_1
,
"Removing dead input %d from %+F (%+F)
\n
"
,
i
,
block
,
pred
));
if
(
!
is_Bad
(
pred
))
{
ir_node
*
pred_block
=
get_nodes_block
(
skip_Proj
(
pred
));
if
(
!
is_Bad
(
pred_block
))
{
node_t
*
pred_bl
=
get_irn_node
(
pred_block
);
if
(
!
is_Bad
(
pred_bl
->
node
)
&&
pred_bl
->
flagged
==
0
)
{
pred_bl
->
flagged
=
3
;
}
}
}
}
}
if
(
k
>=
n
)
...
...
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