https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102943
--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Aldy Hernandez <al...@gcc.gnu.org>: https://gcc.gnu.org/g:e4411622690654cdc530c6262c7115a9e15dc359 commit r12-4904-ge4411622690654cdc530c6262c7115a9e15dc359 Author: Aldy Hernandez <al...@redhat.com> Date: Thu Nov 4 11:34:55 2021 +0100 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.