Improve backwards threader debugging dumps.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 3 Sep 2021 08:57:33 +0000 (10:57 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 3 Sep 2021 15:19:54 +0000 (17:19 +0200)
commit779275c0835b58325f806568836c8b5081d1f52f
tree0de8f433344a2410254741114a2822fbb60c418d
parenta3ff15afb4c697117aa8916c47b358045dbf0fe9
Improve backwards threader debugging dumps.

This patch adds debugging helpers to the backwards threader.  I have
also noticed that profitable_path_p() can bail early on paths that
crosses loops and leave the dump of blocks incomplete.  Fixed as
well.

Unfortunately the new methods cannot be marked const, because we call
the solver's dump which is not const.  I believe this was because the
ranger dump calls m_cache.block_range().  This could probably use a
cleanup at a later time.

Tested on x86-64 Linux.

gcc/ChangeLog:

* tree-ssa-threadbackward.c (back_threader::dump): New.
(back_threader::debug): New.
(back_threader_profitability::profitable_path_p): Dump blocks
even if we are bailing early.
gcc/tree-ssa-threadbackward.c