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

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
The difference I see is that LRA chooses alternative "Q,0,Q" and reload chooses
"d,0,R".

For the "Q,O,Q" LRA reports:

          2 Spill pseudo into memory: reject+=3
          alt=11,overall=9,losers=1,rld_nregs=0

For "d,0,R" it reports:

            0 Non-pseudo reload: reject+=2
            0 Non input pseudo reload: reject++
            1 Dying matched operand reload: reject++
            alt=8,overall=10,losers=1 -- refuse

So it is 9 vs 10.  It would be the same # of insns if we already had a stack
frame.  Most non-toy functions will have a stack frame.  So the problem is not
that bad for a real world scenario.

I'll look what can I do to fix this.  But I should say that it is a very
sensitive code of LRA.  Fiddling with heuristics might affect many programs and
targets and might result in new PRs.

Reply via email to