public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: "Takayuki 'January June' Suwa" <jjsuwa_sys3175@yahoo.co.jp>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] xtensa: Remove old broken tweak for leaf function
Date: Sat, 14 Jan 2023 10:04:58 -0800	[thread overview]
Message-ID: <CAMo8BfKuFW0-JwqVzm_vcNR0dscyPt++4-9ECXyg7v_L8oW06A@mail.gmail.com> (raw)
In-Reply-To: <0707a800-d409-2264-d2a5-21f43ebeaf6f@yahoo.co.jp>

On Fri, Jan 13, 2023 at 9:03 PM Takayuki 'January June' Suwa
<jjsuwa_sys3175@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

      reply	other threads:[~2023-01-14 18:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0707a800-d409-2264-d2a5-21f43ebeaf6f.ref@yahoo.co.jp>
2023-01-14  5:03 ` Takayuki 'January June' Suwa
2023-01-14 18:04   ` Max Filippov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMo8BfKuFW0-JwqVzm_vcNR0dscyPt++4-9ECXyg7v_L8oW06A@mail.gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jjsuwa_sys3175@yahoo.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).