http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57309
Bug ID: 57309 Summary: Spill code degrades vectorized loop for 437.leslie3d on PPC64 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: wschmidt at gcc dot gnu.org CC: bergner at vnet dot ibm.com Host: powerpc*-*-* Target: powerpc*-*-* Build: powerpc*-*-* Note: This bug does NOT occur on current trunk. To reproduce, it's necessary to patch config/rs6000/rs6000.h so that MALLOC_ABI_ALIGNMENT is defined as: #define MALLOC_ABI_ALIGNMENT (TARGET_64BIT ? 128 : 64) This allows more vectorization opportunities for loops that access malloc'd arrays that can be vectorized with 128-bit vectors. I observed that making this change introduces a degradation of SPEC CPU2006 437.leslie3d, built for 64-bit PowerPC Linux. There are a number of degraded loops in the code, which seem to all be pretty similar. In all cases the loops are vectorized with and without the patch, but with the patch there is no need for prolog code to align the data. Unfortunately, with the patch, the loops also contain a great deal of spill code (ld, addi, lxvd2x, stxvd2x) which reloads not only vector registers, but also GPRs used for address computation of vector loads and stores. Without the spill code, the main loop body would be vectorized identically with and without the patch. One of the worst degraded loops is in function fluxk. I have oprofile data available to identify the loop as well as some dumps showing how the loop is transformed in various phases, available by request.