This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, rs6000] Increase MALLOC_ABI_ALIGNMENT for 32-bit PowerPC


This removes two degradations in CPU2006 for 32-bit PowerPC due to lost
vectorization opportunities.  Previously, GCC treated malloc'd arrays as
only guaranteeing 4-byte alignment, even though the glibc implementation
guarantees 8-byte alignment.  This raises the guarantee to 8 bytes,
which is sufficient to permit the missed vectorization opportunities.

The guarantee for 64-bit PowerPC should be raised to 16-byte alignment,
but doing so currently exposes a latent bug that degrades a 64-bit
benchmark.  I have therefore not included that change at this time, but
added a FIXME recording the information.

Bootstrapped and tested on powerpc64-unknown-linux-gnu with no new
regressions.  Verified that SPEC CPU2006 degradations are fixed with no
new degradations.  Ok for trunk?  Also, do you want any backports?

Thanks,
Bill


2013-05-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.h (MALLOC_ABI_ALIGNMENT): New #define.


Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h	(revision 198998)
+++ gcc/config/rs6000/rs6000.h	(working copy)
@@ -2297,6 +2297,13 @@ extern char rs6000_reg_names[][8];	/* register nam
 /* How to align the given loop. */
 #define LOOP_ALIGN(LABEL)  rs6000_loop_align(LABEL)
 
+/* Alignment guaranteed by __builtin_malloc.  */
+/* FIXME:  128-bit alignment is guaranteed by glibc for TARGET_64BIT.
+   However, specifying the stronger guarantee currently leads to
+   a regression in SPEC CPU2006 437.leslie3d.  The stronger
+   guarantee should be implemented here once that's fixed.  */
+#define MALLOC_ABI_ALIGNMENT (64)
+
 /* Pick up the return address upon entry to a procedure. Used for
    dwarf2 unwind information.  This also enables the table driven
    mechanism.  */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]