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?

Jackson

Changelog:

gcc/

2018-06-25  Jackson Woodruff  <jackson.woodr...@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].
Thanks, change made.  OK for trunk?

Thanks,

Jackson
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;
 

Reply via email to