Add debug counters to back threader.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 29 Oct 2021 15:30:42 +0000 (17:30 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 1 Nov 2021 13:24:10 +0000 (14:24 +0100)
commitbc5baac5c37d8da1931043c4bbeffa3ab93a8e91
treecb0493f55ce0e4fbb03833490df0b38e972afcb3
parent4e0f56d7af9dd58f74d67f9cb303936ef595cdf6
Add debug counters to back threader.

Chasing down stage3 miscomparisons is never fun, and having no way to
distinguish between jump threads registered by a particular
pass, is even harder.  This patch adds debug counters for the individual
back threading passes.  I've left the ethread pass alone, as that one is
usually benign, but we could easily add it if needed.

The fact that we can only pass one boolean argument to the passes
infrastructure has us do all sorts of gymnastics to differentiate
between the various back threading passes.

Tested on x86-64 Linux.

gcc/ChangeLog:

* dbgcnt.def: Add debug counter for back_thread[12] and
back_threadfull[12].
* passes.def: Pass "first" argument to each back threading pass.
* tree-ssa-threadbackward.c (back_threader::back_threader): Add
first argument.
(back_threader::debug_counter): New.
(back_threader::maybe_register_path): Call debug_counter.
gcc/dbgcnt.def
gcc/passes.def
gcc/tree-ssa-threadbackward.c