Commit 2ea7f634 authored by Michael Beck's avatar Michael Beck
Browse files

moved the fixpoint iteration of the current node from optimize_graph() to...

moved the fixpoint iteration of the current node from optimize_graph() to transform_node(), a more logical place

[r15025]
parent 77e6a4f4
......@@ -169,19 +169,13 @@ static void enqueue_users(ir_node *n, pdeq *waitq) {
static void opt_walker(ir_node *n, void *env) {
pdeq *waitq = env;
ir_node *optimized;
ir_node *oldn = n;
for (;;) {
optimized = optimize_in_place_2(n);
set_irn_link(optimized, NULL);
if (optimized == n)
break;
n = optimized;
}
if (optimized != oldn) {
enqueue_users(oldn, waitq);
exchange(oldn, optimized);
optimized = optimize_in_place_2(n);
set_irn_link(optimized, NULL);
if (optimized != n) {
enqueue_users(n, waitq);
exchange(n, optimized);
}
}
......
......@@ -3580,8 +3580,19 @@ static ir_node *transform_node_Psi(ir_node *n) {
* not be freed even if the equivalent node isn't the old one.
*/
static ir_node *transform_node(ir_node *n) {
if (n->op->ops.transform_node)
n = n->op->ops.transform_node(n);
ir_node *oldn;
/*
* Transform_node is the only "optimizing transformation" that might
* return a node with a different opcode. We iterate HERE until fixpoint
* to get the final result.
*/
do {
oldn = n;
if (n->op->ops.transform_node)
n = n->op->ops.transform_node(n);
} while (oldn != n);
return n;
} /* transform_node */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment