This is the mail archive of the 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] tree-ssa-threadupdate.c: Speed up threadblock.

On Sat, 2004-10-30 at 08:33 -0400, Kazu Hirata wrote:
> Hi,
> Attached is a patch to speed up threadblock.
> threadblock first adds PHI arguments to the basic block that we wish
> to redirect an edge to before we actually redirect the edge.  It turns
> out that this way of implementation would call phi_arg_from_edge more
> than necessary.  Here is why.
> 1. copy_phis_to_block looks for PHI arguments using an edge that is
>    about to be redirected.
> 2. ssa_redirect_edge, called from redirect_edge_and_branch, stores
>    into PENDING_STMT the PHI arguments from the same edge.
> Both of these operations use phi_arg_from_edge to locate PHI arguments
> on the edge being redirected.
> If we call redirect_edge_and_branch first, we can add PHI arguments to
> the new edge using PENDING_STMT, which is stuffed by
> ssa_redirect_edge.  Note that the running time of phi_arg_from_edge on
> edge E is proportional to EDGE_COUNT (E->dest->preds).
> Tested on i686-pc-linux-gnu.  OK to apply?
> p.s.
> As a good side effect of this patch, we create the redirected edge E
> *before* we add PHI arguments associated with E.  This makes "O(1) PHI
> argument look-up" easier to implement because given E's index in the
> corresponding edge vector, we know where we should put the new PHI
> arguments in the array of PHI arguments.
> Kazu Hirata
> 2004-10-30  Kazu Hirata  <>
> 	* tree-ssa-threadupdate.c (copy_phis_to_block): Install PHI
> 	arguments using PENDING_STMT.
> 	(thread_block): Call copy_phis_to_block after redirecting an
> 	edge.
This is fine.  Please install this patch.


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