On Wed, 2013-04-24 at 15:54 -0700, Steve Ellcey wrote:
>
> /* Copy the basic block that is the destination block of orig_edge, then
> modify/replace the edge in orig_edge->src basic block with a new edge
> that goes to the new block. Fix up any PHI nodes that may need to be
> updated. Remove the dominance info since it may have been messed up. */
>
> edge
> duplicate_succ_block (edge orig_edge)
> {
> edge new_edge;
> basic_block orig_block, new_block;
>
> initialize_original_copy_tables ();
> orig_block = orig_edge->dest;
> fprintf(stderr, "Duplicating block %d\n", orig_block->index);
> new_block = duplicate_block (orig_block, NULL, NULL);
> update_destination_phis (orig_block, new_block);
> new_edge = redirect_edge_and_branch (orig_edge, new_block);
> remove_phi_args (orig_edge);
> free_dominance_info (CDI_DOMINATORS);
> free_original_copy_tables ();
> return new_edge;
> }
Following up to my own reply, I tried adding:
update_ssa (TODO_update_ssa);
to fix up the SSA code but that did not help, I tried it both with and
without the calls to update_destination_phis & remove_phi_args.
Steve Ellcey
[email protected]