aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-10-20 07:29:59 +0200
committerAldy Hernandez <aldyh@redhat.com>2021-10-26 08:20:11 +0200
commit8a04a5fb07f94a2154b362741104f9d48d3e612d (patch)
tree7bff38ae0b98c28d25f3d6c5093521844879e0fb /gcc/tree-vect-loop-manip.c
parentf6d012338bf87f427b7420f2f309963c29fe33ba (diff)
downloadgcc-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-vect-loop-manip.c')
0 files changed, 0 insertions, 0 deletions