Starting Aug 20, there is about 1.5% degradation on x86 SPEC2000, please see http://vmakarov.fedorapeople.org/spec/.

The reason for this was my patch http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01623.html for solving code performance degradation on MIPS.

Instead of using explicitly necessary number of registers, I used contains_reg_of_mode which also checks the number of necessary registers but also it checks that the register class can hold value of given mode. This resulted in different register pressure classes (before the patch, they were GENERAL_REGS and FLOAT_REGS for x86. They became only INT_FLOAT_REGS) because it became not costly to hold integer mode value in FLOAT_REGS. The new register pressure class in own turn resulted in low register pressure and one region allocation in most cases instead of multiple region RA. As a consequence, we got a big degradation on Intel 32 bit targets.

I did check code differences and did not find the code difference on my Aug 19 patch in 32-bit and 64-bit mode. My mistake was in that I used a very small tests for which one region allocation was used with and without the patch.

Sorry for any inconvenience. It is always hard to fix performance bugs in IRA because it is very machine-dependent pass which is always used in GCC.

The following patch should be the right patch. It does not result in code difference on x86 and x86-64 SPEC2000 any more. It still solves the mips code performance problem and was successfully bootstrapped on x86-64.

  Committed as rev. 178019.

2011-08-23  Vladimir Makarov <vmaka...@redhat.com>

        * ira.c (ira_init_register_move_cost): Check small subclasses
        through ira_reg_class_max_nregs and ira_available_class_regs.

Index: ira.c
===================================================================
--- ira.c       (revision 177968)
+++ ira.c       (working copy)
@@ -1503,7 +1503,7 @@ ira_init_register_move_cost (enum machin
     {
       /* Some subclasses are to small to have enough registers to hold
         a value of MODE.  Just ignore them.  */
-      if (! contains_reg_of_mode[cl1][mode])
+      if (ira_reg_class_max_nregs[cl1][mode] > ira_available_class_regs[cl1])
        continue;
       COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl1]);
       AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);

Reply via email to