This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [AArch64] Generate load-pairs when the last load clobbers the address register [2/2]
- From: Sudakshina Das <sudi dot das at arm dot com>
- To: Jackson Woodruff <jackson dot woodruff at arm dot com>, gcc-patches at gcc dot gnu dot org
- Cc: richard dot earnshaw at arm dot com, 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: Tue, 10 Jul 2018 14:29:13 +0100
- Subject: Re: [AArch64] Generate load-pairs when the last load clobbers the address register [2/2]
- References: <14c4dfab-ef38-5ae5-be40-2f7ea433642d@arm.com>
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?
Jackson
Changelog:
gcc/
2018-06-25 Jackson Woodruff <jackson.woodruff@arm.com>
PR target/86014
* config/aarch64/aarch64.c
(aarch64_operands_adjust_ok_for_ldpstp):
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].
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index d0e9b2d464183eecc8cc7639ca3e981d2ff243ba..feffe8ebdbd4efd0ffc09834547767ceec46f4e4 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -17074,7 +17074,7 @@ aarch64_operands_adjust_ok_for_ldpstp (rtx *operands, bool 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;
Thanks
Sudi