public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>,
	Richard Biener <richard.guenther@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Subject: Re: [PATCH v2] xtensa: Make full transition to LRA
Date: Mon, 8 May 2023 16:26:45 -0600	[thread overview]
Message-ID: <dc496a16-2d62-58e6-da31-29356641a152@gmail.com> (raw)
In-Reply-To: <42c4f026-3045-c469-e62f-24d7c26cd431@yahoo.co.jp>



On 5/8/23 08:44, Takayuki 'January June' Suwa via Gcc-patches wrote:
> On 2023/05/08 22:43, Richard Biener wrote:
> [snip]
>>> -mlra
>>
>> If they were in any released compiler options should be kept
>> (doing nothing) for backward compatibility.  Use for example
>>
>> mlra
>> Target WarnRemoved
>> Removed in GCC 14.  This switch has no effect.
>>
>> or
>>
>> mlra
>> Target Ignore
>> Does nothing.  Preserved for backward compatibility.
>>
>> which doesn't inform the user (I think that's the better choice here).
>>
>>> -Target Mask(LRA)
> Thank you for your helpful advice.
> 
> =====
> gcc/ChangeLog:
> 
> 	* config/xtensa/constraints.md (R, T, U):
> 	Change define_constraint to define_memory_constraint.
> 	* config/xtensa/xtensa.cc
> 	(xtensa_lra_p, TARGET_LRA_P): Remove.
> 	(xtensa_emit_move_sequence): Remove "if (reload_in_progress)"
> 	clause as it can no longer be true.
> 	(xtensa_output_integer_literal_parts): Consider 16-bit wide
> 	constants.
> 	(xtensa_legitimate_constant_p): Add short-circuit path for
> 	integer load instructions.
> 	* config/xtensa/xtensa.md (movsf): Use can_create_pseudo_p()
> 	rather reload_in_progress and reload_completed.
> 	* config/xtensa/xtensa.opt (mlra): Change to no effect.
> ---
>   gcc/config/xtensa/constraints.md | 26 ++++++++------------------
>   gcc/config/xtensa/xtensa.cc      | 26 +++++---------------------
>   gcc/config/xtensa/xtensa.md      |  2 +-
>   gcc/config/xtensa/xtensa.opt     |  4 ++--
>   4 files changed, 16 insertions(+), 42 deletions(-)
> 
> diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
> index 53e4d0d8dd1..9b31e162941 100644
> --- a/gcc/config/xtensa/constraints.md
> +++ b/gcc/config/xtensa/constraints.md
> @@ -123,29 +123,19 @@
>         (and (match_code "const_int")
>   	   (match_test "! xtensa_split1_finished_p ()"))))
>   
> -;; Memory constraints.  Do not use define_memory_constraint here.  Doing so
> -;; causes reload to force some constants into the constant pool, but since
> -;; the Xtensa constant pool can only be accessed with L32R instructions, it
> -;; is always better to just copy a constant into a register.  Instead, use
> -;; regular constraints but add a check to allow pseudos during reload.
> +;; Memory constraints.
>   
> -(define_constraint "R"
> +(define_memory_constraint "R"
>    "Memory that can be accessed with a 4-bit unsigned offset from a register."
> - (ior (and (match_code "mem")
> -	   (match_test "smalloffset_mem_p (op)"))
> -      (and (match_code "reg")
> -	   (match_test "reload_in_progress
> -			&& REGNO (op) >= FIRST_PSEUDO_REGISTER"))))
> + (and (match_code "mem")
> +      (match_test "smalloffset_mem_p (op)")))
>   
> -(define_constraint "T"
> +(define_memory_constraint "T"
>    "Memory in a literal pool (addressable with an L32R instruction)."
>    (and (match_code "mem")
>         (match_test "!TARGET_CONST16 && constantpool_mem_p (op)")))
>   
> -(define_constraint "U"
> +(define_memory_constraint "U"
>    "Memory that is not in a literal pool."
> - (ior (and (match_code "mem")
> -	   (match_test "! constantpool_mem_p (op)"))
> -      (and (match_code "reg")
> -	   (match_test "reload_in_progress
> -			&& REGNO (op) >= FIRST_PSEUDO_REGISTER"))))
> + (and (match_code "mem")
> +      (match_test "! constantpool_mem_p (op)")))
Given the old comment, you might want to use 
define_special_memory_constraint rather than define_memory_constraint.

It might be worth doing some before/after comparisons to see if there's 
any noticeable impact.

jeff

  reply	other threads:[~2023-05-08 22:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <91ddbcb5-67e2-2c30-a81e-6b20e3c8e1a4.ref@yahoo.co.jp>
2023-05-08 13:38 ` [PATCH] " Takayuki 'January June' Suwa
2023-05-08 13:43   ` Richard Biener
2023-05-08 14:44     ` [PATCH v2] " Takayuki 'January June' Suwa
2023-05-08 22:26       ` Jeff Law [this message]
2023-05-10  9:10   ` [PATCH] " Max Filippov
2024-01-24  5:07     ` Max Filippov
2024-01-24  5:15 [PATCH v2] " Max Filippov

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=dc496a16-2d62-58e6-da31-29356641a152@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=jjsuwa_sys3175@yahoo.co.jp \
    --cc=richard.guenther@gmail.com \
    /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).