# include <config.h>
#endif
+# include "irvrfy.h"
+# include "irflag.h"
+# include "irgwalk.h"
# include "irnode_t.h"
# include "irgraph_t.h"
# include "irgmod.h"
/* Insert irnode `new' in place of irnode `old'
Since `new' may be bigger than `old' replace `old'
by an op_Id which is smaller than everything */
-inline void
-exchange (ir_node *old, ir_node *new)
+INLINE void
+exchange (ir_node *old, ir_node *nw)
{
ir_node *block = old->in[0];
old->op = op_Id;
old->in = NEW_ARR_D (ir_node *, current_ir_graph->obst, 2);
old->in[0] = block;
- old->in[1] = new;
+ old->in[1] = nw;
}
-
/**********************************************************************/
-/* Funcionality for collect_phis */
+/* Functionality for collect_phis */
/**********************************************************************/
void
ir_node *old_block;
ir_node *phi;
+ /* Turn off optimizations so that blocks are not merged again. */
+ int rem_opt = get_optimize();
+ set_optimize(0);
+
/* Transform the control flow */
old_block = get_nodes_Block(node);
new_block = new_Block(get_Block_n_cfgpreds(old_block),
set_irn_link(new_block, phi);
set_irn_link(old_block, NULL);
while (phi) {
- set_nodes_Block(phi, new_block);
+ if(get_nodes_Block(phi) == old_block); /* @@@ inlinening chokes on phis that don't
+ obey this condition. How do they get into
+ the list??? Example: InterfaceIII */
+ set_nodes_Block(phi, new_block);
phi = get_irn_link(phi);
}
+
+ set_optimize(rem_opt);
}