This is the mail archive of the
mailing list for the GCC project.
Re: [AArch64] Generate load-pairs when the last load clobbers the address register [2/2]
- From: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- To: Jackson Woodruff <jackson dot woodruff at arm dot com>, Sudakshina Das <sudi dot das at arm dot com>, gcc-patches at gcc dot gnu dot org
- Cc: james dot greenhalgh at arm dot com, marcus dot shawcroft at arm dot com, nd at arm dot com, kyrylo dot tkachov at foss dot arm dot com, christophe dot lyon at linaro dot org
- Date: Thu, 12 Jul 2018 17:35:47 +0100
- Subject: Re: [AArch64] Generate load-pairs when the last load clobbers the address register [2/2]
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
On 11/07/18 17:48, Jackson Woodruff wrote:
> Hi Sudi,
> On 07/10/2018 02:29 PM, Sudakshina Das wrote:
>> Hi Jackson
>> On Tuesday 10 July 2018 09:37 AM, Jackson Woodruff wrote:
>>> Hi all,
>>> This patch resolves PR86014. It does so by noticing that the last
>>> load may clobber the address register without issue (regardless of
>>> where it exists in the final ldp/stp sequence). That check has been
>>> changed so that the last register may be clobbered and the testcase
>>> (gcc.target/aarch64/ldp_stp_10.c) now passes.
>>> Bootstrap and regtest OK.
>>> OK for trunk?
>>> 2018-06-25 Jackson Woodruff <firstname.lastname@example.org>
>>> PR target/86014
>>> * config/aarch64/aarch64.c
>>> Remove address clobber check on last register.
>> This looks good to me but you will need a maintainer to approve it.
>> The only
>> thing I would add is that if you could move the comment on top of the
>> for loop
>> to this patch. That is, keep the original
>> /* Check if the addresses are clobbered by load. */
>> in your [1/2] and make the comment change in [2/2].
> Thanks, change made. OK for trunk?
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index da44b33b2bc12f9aa2122cf5194e244437fb31a5..8a027974e9772cacf5f5cb8ec61e8ef62187e879 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -17071,9 +17071,10 @@ aarch64_operands_adjust_ok_for_ldpstp (rtx *operands, bool load,
> return false;
> - /* Check if addresses are clobbered by load. */
> + /* Only the last register in the order in which they occur
> + may be clobbered by the load. */
> if (load)
> - for (int i = 0; i < num_instructions; i++)
> + for (int i = 0; i < num_instructions - 1; i++)
> if (reg_mentioned_p (reg[i], mem[i]))
> return false;
Can we have a new test for this?
Also, if rclass (which you calculate later) is FP_REGS, then the test is
redundant since mems can never use FP registers as a base register.