On Thu, Feb 26, 2026 at 1:21 AM H.J. Lu <[email protected]> wrote:
>
> ix86_access_stack_p can be quite expensive.  Cache the result and call it
> only if there are symbolic constant loads.  This reduces the compile time
> of PR target/124165 test from 202 seconds to 55 seconds.

I have my reservations about the overall architecture of
ix86_find_max_used_stack_alignment
but I verified the patch delivers the expected speedup and I agree
that this seems to be
a way forward without re-architecting ix86_find_max_used_stack_alignment, which,
I think would likely not be appropriate at this point.

Richard.

> gcc/
>
> PR target/124165
> * config/i386/i386-protos.h (symbolic_reference_mentioned_p):
> Change the argument type from rtx to const_rtx.
> * config/i386/i386.cc (symbolic_reference_mentioned_p): Likewise.
> (ix86_access_stack_p): Add 2 auto_bitmap[] arguments.  Cache
> the register BB domination result.
> (ix86_symbolic_const_load_p_1): New.
> (ix86_symbolic_const_load_p): Likewise.
> (ix86_find_max_used_stack_alignment): If there is no symbolic
> constant load into the register, don't call ix86_access_stack_p.
>
>
> --
> H.J.

Reply via email to