On 4/4/24 6:41 AM, Richard Biener wrote:
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%).

Bootstrapped and tested on x86_64-unknown-linux-gnu, OK for trunk?

Thanks,
Richard.

        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.
OK.  Your call on whether or not to include in gcc-14 or wait for gcc-15.

jeff

Reply via email to