On Fri, Jan 13, 2023 at 9:03 PM Takayuki 'January June' Suwa <jjsuwa_sys3...@yahoo.co.jp> wrote: > > 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 | 2 +- > gcc/config/xtensa/xtensa.cc | 77 +++++++------------------------ > gcc/config/xtensa/xtensa.h | 51 ++++++-------------- > 3 files changed, 31 insertions(+), 99 deletions(-)
Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max