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] tree-ssa-dom.c: Speed up thread_across_edge.


On Thu, 2004-12-09 at 23:34 -0500, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to speed up thread_across_edge.
> 
> Consider
> 
>   cached_lhs = local_fold (COND_EXPR_COND (dummy_cond));
>   if (! is_gimple_min_invariant (cached_lhs))
>     cached_lhs = lookup_avail_expr (dummy_cond, false);
>   if (!cached_lhs || ! is_gimple_min_invariant (cached_lhs))
>     {
>       cached_lhs = simplify_cond_and_lookup_avail_expr (dummy_cond,
> 							NULL,
> 							false);
>     }
> 
> Note that the statement inside the second "if" is executed only when
> local_fold fails to produce a gimple min invariant.  In other words,
> if the condition in the first "if" is false, we have a nonzero
> cached_lhs and a gimple min invariant.
> 
> The patch manually performs jump threading.
> 
> The resulting code makes sense conceptually, too.  If we already have
> a gimple min variant, why do we want to continue to poke at it?
> 
> Tested on i686-pc-linux-gnu.  OK to apply?
> 
> Kazu Hirata
> 
> 2004-12-10  Kazu Hirata  <kazu@cs.umass.edu>
> 
> 	* tree-ssa-dom.c (thread_across_edge): Speed up by avoiding a
> 	call to is_gimple_min_invariant if we know the result.
This is fine.
jeff



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