Combine stack adjustments.
Copyright (C) 1987-2024 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>.
Track stack adjustments and stack memory references. Attempt to
reduce the number of stack adjustments by back-propagating across
the memory references.
This is intended primarily for use with targets that do not define
ACCUMULATE_OUTGOING_ARGS. It is of significantly more value to
targets that define PREFERRED_STACK_BOUNDARY more aligned than
STACK_BOUNDARY (e.g. x86), or if not all registers can be pushed
(e.g. x86 fp regs) which would ordinarily have to be implemented
as a sub/mov pair due to restrictions in calls.cc.
Propagation stops when any of the insns that need adjusting are
(a) no longer valid because we've exceeded their range, (b) a
non-trivial push instruction, or (c) a call instruction.
Restriction B is based on the assumption that push instructions
are smaller or faster. If a port really wants to remove all
pushes, it should have defined ACCUMULATE_OUTGOING_ARGS. The
one exception that is made is for an add immediately followed
by a push.
This structure records two kinds of stack references between stack
adjusting instructions: stack references in memory addresses for
regular insns and all stack references for debug insns.