This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] move superblock formation to Tree-SSA


Hello,

> +/* Makes a copy of ORIG and redirects the edge BB->ORIG to the copy.  This
> +   function fixes up the PHI nodes in the copy's successors.  The copy
> +   of ORIG is returned. */
> +
> +static basic_block
> +copy_block_and_fix_phi (basic_block bb, basic_block orig)
> +{
> +  edge e, e2;
> +  edge_iterator ei2;
> +  basic_block copy;
> +  tree phi;
> +
> +  e = find_edge (bb, orig);
> +
> +  copy = duplicate_block (orig, e, bb);
> +  flush_pending_stmts (e);


> +  FOR_EACH_EDGE (e2, ei2, copy->succs)
> +    {
> +      e = find_edge (orig, e2->dest);
> +
> +      for (phi = phi_nodes (e2->dest); phi; phi = PHI_CHAIN (phi))
> +	add_phi_arg (phi, PHI_ARG_DEF_FROM_EDGE (phi, e), e2);
> +    }
> +
> +  return copy;
> +}

this can be simplified using tree-cfg.c:add_phi_args_after_copy.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]