]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86: Call ix86_access_stack_p only with symbolic constant load
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 22 Feb 2026 02:32:30 +0000 (10:32 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 3 Mar 2026 22:09:19 +0000 (06:09 +0800)
commita7cce1afee8ba28c524a4a43f0081e36e5501cf2
tree9778f6c23e64cdeab435a53652be26df7c545108
parent958d1a881940c6551757958e9da27597420a6d52
x86: Call ix86_access_stack_p only with symbolic constant load

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.

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.

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