]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/114579 - speed up add_scope_conflicts
authorRichard Biener <rguenther@suse.de>
Thu, 4 Apr 2024 12:00:10 +0000 (14:00 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 2 May 2024 06:31:54 +0000 (08:31 +0200)
commitbbe83599320288025a417c54d9afcb3885cb2766
treeed5f766a5f82786936447ccc68062efa10ab99b7
parentad30265ccfb211fca35789df2d1404cc12302219
middle-end/114579 - speed up add_scope_conflicts

The following speeds up stack variable conflict detection by recognizing
that the all-to-all conflict recording is only necessary for CFG merges
as it's the unioning of the live variable sets that doesn't come with
explicit mentions we record conflicts for.

If we employ this optimization we have to make sure to perform the
all-to-all conflict recording for all CFG merges even those into
empty blocks where we might previously have skipped this.

I have reworded the comment before the all-to-all conflict recording
since it seemed to be confusing and missing the point - but maybe I
am also missing something here.

Nevertheless for the testcase in the PR the compile-time spend in
add_scope_conflicts at -O1 drops from previously 67s (39%) to 10s (9%).

PR middle-end/114579
* cfgexpand.cc (add_scope_conflicts_1): Record all-to-all
conflicts only when there's a CFG merge but for all CFG merges.
gcc/cfgexpand.cc