]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/xtensa/xtensa.cc
xtensa: Remove old broken tweak for leaf function
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Sat, 14 Jan 2023 05:03:55 +0000 (14:03 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 14 Jan 2023 18:03:14 +0000 (10:03 -0800)
commitff6c7617102df365918402c6ccc8e497c47dbe60
tree3a2b627b67a43b13f8938fb695bdaf66eec582b5
parenta3b99b84609af310c72b4d6221621f5b63a3c169
xtensa: Remove old broken tweak for leaf function

In the before-IRA era, ORDER_REGS_FOR_LOCAL_ALLOC was called for each
function in Xtensa, and there was register allocation table reordering
for leaf functions to compensate for the poor performance of local-alloc.

Today the adjustment hook is still called via its alternative
ADJUST_REG_ALLOC_ORDER, but it is only called once at the start of the IRA,
and leaf_function_p() erroneously returns true and also gives no argument
count.

That straightforwardly misleads register allocation that all functions are
always leaves with no arguments, which leads to inefficiencies in allocation
results.

Fortunately, IRA is smart enough than local-alloc to not need such assistance.

This patch does away with the antiquated by removing the wreckage that no
longer works.

gcc/ChangeLog:

* config/xtensa/xtensa-protos.h (order_regs_for_local_alloc):
Rename to xtensa_adjust_reg_alloc_order.
* config/xtensa/xtensa.cc (xtensa_adjust_reg_alloc_order):
Ditto.  And also remove code to reorder register numbers for
leaf functions, rename the tables, and adjust the allocation
order for the call0 ABI to use register A0 more.
(xtensa_leaf_regs): Remove.
* config/xtensa/xtensa.h (REG_ALLOC_ORDER): Cosmetics.
(order_regs_for_local_alloc): Rename as the above.
(LEAF_REGISTERS, LEAF_REG_REMAP, leaf_function): Remove.
gcc/config/xtensa/xtensa-protos.h
gcc/config/xtensa/xtensa.cc
gcc/config/xtensa/xtensa.h