]> git.ipfire.org Git - thirdparty/gcc.git/commit
IRA: Use minimal cost for hard register movement
authorVladimir N. Makarov <vmakarov@redhat.com>
Thu, 2 Mar 2023 21:29:05 +0000 (16:29 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Fri, 31 Mar 2023 12:14:20 +0000 (08:14 -0400)
commit88792f04e5c63025506244b9ac7186a3cc10c25a
tree361abcf5456482856a6ecab012dac8149d5c00e1
parentefa5d940aca937fbe5a4469ef46714047a335ba5
IRA: Use minimal cost for hard register movement

This is the 2nd attempt to fix PR90706.  IRA calculates wrong AVR
costs for moving general hard regs of SFmode.  This was the reason for
spilling a pseudo in the PR.  In this patch we use smaller move cost
of hard reg in its natural and operand modes.

        PR rtl-optimization/90706

gcc/ChangeLog:

* ira-costs.cc: Include print-rtl.h.
(record_reg_classes, scan_one_insn): Add code to print debug info.
(record_operand_costs): Find and use smaller cost for hard reg
move.

gcc/testsuite/ChangeLog:

* gcc.target/avr/pr90706.c: New.
gcc/ira-costs.cc
gcc/testsuite/gcc.target/avr/pr90706.c [new file with mode: 0644]