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
0ba3dfb1
Commit
0ba3dfb1
authored
Feb 22, 2015
by
yb9976
Browse files
Localopt: Reach fixpoint in more cases.
parent
00e91c32
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/irgopt.c
View file @
0ba3dfb1
...
...
@@ -130,11 +130,22 @@ static void opt_walker(ir_node *n, void *env)
pdeq
*
waitq
=
(
pdeq
*
)
env
;
set_irn_link
(
n
,
NULL
);
ir_node
*
optimized
=
optimize_in_place_2
(
n
);
if
(
optimized
!=
n
)
{
enqueue_users
(
n
,
waitq
);
exchange
(
n
,
optimized
);
}
/* If CSE occurs during the optimization,
* our operands have fewer users than before.
* Thus, we may be able to apply a rule that
* requires an operand with only one user.
* Hence, we need a loop to reach the fixpoint. */
ir_node
*
optimized
=
n
;
ir_node
*
last
;
do
{
last
=
optimized
;
optimized
=
optimize_in_place_2
(
last
);
if
(
optimized
!=
last
)
{
enqueue_users
(
last
,
waitq
);
exchange
(
last
,
optimized
);
}
}
while
(
optimized
!=
last
);
}
void
optimize_graph_df
(
ir_graph
*
irg
)
...
...
Write
Preview
Markdown
is supported
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