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]

Speed up SSA verification (pr15524)


Verification of the SSA graph represents roughly 10% of the total time
we burn for pr15524 and it's pretty consistently near the top of the
timevar totals these days.

There's a few things we can do to decrease the overhead associated with
verifying the correctness of the SSA information:

  1. Avoid useless walks over PHI arguments.  We were still examining
     each PHI argument twice.  Once during the walk over the statements
     to register definitions, then again in verify_phi_args.  The walk
     in verify_ssa is easily eliminated by putting its check inside
     verify_phi_args -- which is where the check in question beloned
     anyway.

  2. Avoid useless walks over the block preds list.  With a little 
     intelligence and coalescing of two error conditions we can
     avoid one walk over the block preds list in verify_phi_args.

  3. Avoid useless walks over the IL.  verify_ssa walked the IL
     twice.  Once to verify/register definitions, then again to
     verify/register uses.  The verify/registering of definitions
     can be done without walking the statements by instead walking
     the SSA_NAME formal table -- which turns out to be significantly
     more efficient.

Those three things reduce the overhead of verify_ssa by around
20% for pr15524 (for a corresponding 2% net improvement).  Nothing
spectacular, but I suspect the  remaining improvements are all going
to be of this nature.  A percent or two here in different key areas.

verify_ssa is still rather expensive, I'm going to have to think harder
about how to speed it up without losing any of the valuable checks it
performs.

Bootstrapped and regression tested.

Attachment: PPP
Description: Text document


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