diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-10-20 07:29:59 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-10-26 08:20:11 +0200 |
commit | 8a04a5fb07f94a2154b362741104f9d48d3e612d (patch) | |
tree | 7bff38ae0b98c28d25f3d6c5093521844879e0fb /gcc/tree-vectorizer.h | |
parent | f6d012338bf87f427b7420f2f309963c29fe33ba (diff) | |
download | gcc-8a04a5fb07f94a2154b362741104f9d48d3e612d.zip gcc-8a04a5fb07f94a2154b362741104f9d48d3e612d.tar.gz gcc-8a04a5fb07f94a2154b362741104f9d48d3e612d.tar.bz2 |
Attempt to resolve all incoming paths to a PHI.
The code that threads incoming paths to a PHI is duplicating what we
do generically in find_paths_to_names. This shortcoming is actually
one of the reasons we aren't threading all possible paths into a PHI.
For example, we give up after finding one threadable path, but some
PHIs have multiple threadable paths:
// x_5 = PHI <10(4), 20(5), ...>
// if (x_5 > 5)
Addressing this not only fixes the oversight, but simplifies the
PHI handling code, since we can consider the PHI fully resolved upon
return.
Interestingly, for ssa-thread-12.c the main thread everything was
hinging on was unreachable. With this patch, we call
maybe_register_path() earlier. In doing so, the solver realizes
that any path starting with 4->8 is unreachable and can be avoided.
This caused the cascade of threadable paths that depended on this
to no longer happen. Since threadable paths in thread[34] was the only
thing this test was testing, there's no longer anything to test. Neat!
Tested on x86-64 Linux.
gcc/ChangeLog:
* tree-ssa-threadbackward.c (back_threader::resolve_phi):
Attempt to resolve all incoming paths to a PHI.
(back_threader::resolve_def): Always return true for PHIs.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr21090.c: Adjust for threading.
* gcc.dg/tree-ssa/ssa-thread-12.c: Removed.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions