]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Call ix86_access_stack_p only for larger alignment
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Mar 2026 21:30:28 +0000 (14:30 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 31 Mar 2026 12:29:58 +0000 (05:29 -0700)
commitf511bf93f947199a9f9099fee87b7052e5515fb9
tree003ef65585e275ccee008f4f4c65753e954e0227
parent5312b5132ce3177cad5c6eea09ae76b046f4deae
x86: Call ix86_access_stack_p only for larger alignment

ix86_access_stack_p can be quite expensive.  Don't check symbolic constant
load.  Instead, call ix86_access_stack_p only if an INSN needs alignment
> stack alignment.  This reduces the compile time of PR target/124684 from
185 seconds to 24 seconds.  The compile time of PR target/124165 test is
unchanged.

PR target/124165
PR target/124684
* config/i386/i386.cc (ix86_symbolic_const_load_p_1): Renamed to
...
(ix86_need_alignment_p_1): This.
(ix86_symbolic_const_load_p): Renamed to ...
(ix86_need_alignment_p): This.
(ix86_find_max_used_stack_alignment): Call ix86_access_stack_p
only if the INSN needs alignment > stack alignment.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/config/i386/i386.cc