https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128174

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vladimir Makarov <[email protected]>:

https://gcc.gnu.org/g:bb77ebb8b6a4ae850fd74c7969909dba72d5360c

commit r17-5746-gbb77ebb8b6a4ae850fd74c7969909dba72d5360c
Author: Vladimir N. Makarov <[email protected]>
Date:   Thu Oct 29 14:36:37 2026 -0400

    [PR 128174][LRA]: Propagate invariants (equivalence) for inherited pseudos

    In the PR test case we have too many insns using invariants (sfp +
    constant) and for all of them after sfp elimination the offset is out
    of immediate range.  So all the insns are reloaded.  Invariant
    inheritance creates a lot of inheritance pseudos, some of them should
    be spilled (thumb1 has few hard regs) and this results in increase of
    stack frame making insns containing sfp to be reloaded again and
    results in additional inheritance.  This process is extremely slow and
    requires generation of many reload insns.

    To fix this, we record that the inheritance pseudos have equivalence
    and use the equivalence instead of inheritance pseudo spilling.
    Spilling would be a pessimization anyway (reloading from the slot is
    no cheaper than rematerialization). Also the extra slot would change
    the frame size and therefore the elimination offsets, which would
    invalidate every insn mentioning an eliminable register.  With many
    invariant occurrences that feedback would keep LRA iterating for a
    very long time.

    gcc/ChangeLog:

            PR middle-end/128174
            * lra-constraints.cc (add_invariant): New function.
            (process_invariant_for_inheritance): Call add_invariant.

Reply via email to