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>
Thu, 2 Mar 2023 21:39:13 +0000 (16:39 -0500)
commit2639f9d2313664e6b4ed2f8131fefa60aeeb0518
treebf25a69e196cdb78727d2e8471e93d5f334d6ef3
parentce9cd7258d0b2d34e14663f8d91be8d6a4731204
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]