Avoid repeating calculations in threader.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 4 Nov 2021 10:34:55 +0000 (11:34 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Thu, 4 Nov 2021 14:37:35 +0000 (15:37 +0100)
commite4411622690654cdc530c6262c7115a9e15dc359
treeb85bf7a4a2323863c830bf1b26c9530eff218f54
parent5ea1ce43b6070aaa94882e8b15f3340344aaa6b2
Avoid repeating calculations in threader.

We already attempt to resolve the current path on entry to
find_paths_to_name(), so there's no need to do so again for each
exported range since nothing has changed.

Removing this redundant calculation avoids 22% of calls into the path
solver.

Tested on x86-64 and ppc64le Linux with the usual regstrap.  I also
verified that the before and after number of threads was the same
in a suite of .ii files from a bootstrap.

gcc/ChangeLog:

PR tree-optimization/102943
* tree-ssa-threadbackward.c (back_threader::find_paths_to_names):
Avoid duplicate calculation of paths.
gcc/tree-ssa-threadbackward.c