[arm] inhibit LDM peepholes for xscale

Philip Blundell pb@nexus.co.uk
Sat May 17 13:46:00 GMT 2003


When tuning for xscale, peepholing two LDRs into an LDM would generally
be a loss.

In fact, arith_adjacentmem looks like it will sometimes transform two
LDRs into an ADD followed by an LDM, which is probably a loss on any
Harvard core.  But I guess we can worry about that separately.

p.

-------------- next part --------------
2003-05-16  Philip Blundell  <philb@gnu.org>

	* config/arm/arm.c (load_multiple_sequence): Avoid LDM if tuning
	for xscale and not -Os.
	(store_multiple_sequence): Likewise.
	* config/arm/arm.md (arith_adjacentmem): Likewise.

Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.274
diff -u -p -r1.274 arm.c
--- config/arm/arm.c	15 May 2003 18:38:20 -0000	1.274
+++ config/arm/arm.c	16 May 2003 20:47:00 -0000
@@ -4731,6 +4731,10 @@ load_multiple_sequence (operands, nops, 
   if (nops < 2 || nops > 4)
     abort ();
 
+  /* See comment in arm_gen_load_multiple.  */
+  if (arm_tune_xscale && !optimize_size && nops <= 2)
+    return 0;
+
   /* Loop over the operands and check that the memory references are
      suitable (ie immediate offsets from the same base register).  At
      the same time, extract the target register, and the memory
@@ -4966,6 +4970,10 @@ store_multiple_sequence (operands, nops,
   if (nops < 2 || nops > 4)
     abort ();
 
+  /* See comment in arm_gen_load_multiple.  */
+  if (arm_tune_xscale && !optimize_size && nops <= 2)
+    return 0;
+
   /* Loop over the operands and check that the memory references are
      suitable (ie immediate offsets from the same base register).  At
      the same time, extract the target register, and the memory
Index: config/arm/arm.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.md,v
retrieving revision 1.134
diff -u -p -r1.134 arm.md
--- config/arm/arm.md	15 May 2003 18:38:21 -0000	1.134
+++ config/arm/arm.md	16 May 2003 20:47:50 -0000
@@ -7523,7 +7523,7 @@
 	 [(match_operand:SI 2 "memory_operand" "m")
 	  (match_operand:SI 3 "memory_operand" "m")]))
    (clobber (match_scratch:SI 4 "=r"))]
-  "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
+  "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
   "*
   {
     rtx ldm[3];


More information about the Gcc-patches mailing list