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] Speed up rewrite_update_phi_arguments


On Sat, 2006-04-15 at 21:51 +0200, Zdenek Dvorak wrote:
> Hello,
> 
> most of the time in PR 26830 is spent in rewrite_update_phi_arguments.
> During ssa update, this function traverses all phi nodes in the
> interesting blocks; however, most of these phi nodes are not interesting
> (less than 2%).  This patch makes us remember the interesting phi nodes
> (those for that mark_use_interesting was called) and traverse only
> those.  This decreases time spent in rewrite_update_phi_arguments
> from 94s to close to nothing (2s), speeding up gcc on this testcase
> about twice.
> 
> Bootstrapped & regtested on ia64.
> 
> Zdenek
> 
> 	* tree-into-ssa.c (phis_to_rewrite, blocks_with_phis_to_rewrite): New
> 	variables.
> 	(mark_phi_for_rewrite): New function.
> 	(insert_phi_nodes_for, mark_use_interesting): Call
> 	mark_phi_for_rewrite.
> 	(rewrite_update_phi_arguments): Traverse only phis in phis_to_rewrite.
> 	(update_ssa): Initialize and free phis_to_rewrite.
Seems reasonable to me.  My only question would be whether or not this
had any impact on more "normal" tests.  ie, are we paying a compile
time penalty for normal code to make this testcase faster?

While I would expect this to be performance neutral for "normal" tests,
I think we're still OK if it's a small compile-time penalty for "normal"
tests.  But we should at least have some data so that we can make
an informed decision.

Thanks,

jeff



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