This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Speed up rewrite_update_phi_arguments
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.
I have timed preprocessed gcc sources, the results are within noise
(given that usually less then 1% of compilation time is spent in phi
rewriting, it is hard to get anything reliable on "normal" tests).
Zdenek