https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127661
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Kyrylo Tkachov <[email protected]>: https://gcc.gnu.org/g:b58e9cec4c02e4e8b156dd1c875d37f87b85ddeb commit r17-4987-gb58e9cec4c02e4e8b156dd1c875d37f87b85ddeb Author: Kyrylo Tkachov <[email protected]> Date: Tue Sep 29 16:58:50 2026 +0200 cprop: Cache find_bypass_set results per block [PR127661] find_bypass_set walks the chain of the sets of a register in the hash table until it finds one that is available at the end of a block. The testcase of the PR has N tests "if (v == K)", and each gives an implicit set of v, so the chain has N entries. Jump bypassing repeats the query for the source of an edge each time it moves the edge, about N*N/2 times in total, and after the previous patch this walk takes most of the time that is left in cprop. The set hash table and CPROP_AVOUT do not change while jumps are bypassed, so this patch caches the last query for each basic block and its result. The new test checks that two registers queried from the same block get their own sets. For the testcase at N=2048 on Grace the compile time drops by a further 30%. The generated code does not change. Bootstrapped and tested as a series on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ChangeLog: PR rtl-optimization/127661 * cprop.cc (struct bypass_set_cache_entry): New. (bypass_set_cache): New variable. (find_bypass_set): Use and update it. (bypass_conditional_jumps): Allocate and free it. gcc/testsuite/ChangeLog: PR rtl-optimization/127661 * gcc.dg/pr127661-2.c: New test. Signed-off-by: Kyrylo Tkachov <[email protected]>
