The attached preprocessed code in the first attachment is that of the adler32
function in zlib-1.1.3.  It comes highest in the profile of a zlib-based
performance regression test (the "example" program with no parameters).
I'm attaching the assembly code corresponding to gcc-3.2.1 for cris-axis-elf
with -O2 -march=v10 -fno-gcse -fno-reorder-blocks (the latter options being the
default in our local distribution) as well as the versions for the 4.3 branch
at 141344 and trunk at 141361 with the same options.  Note the larger stack
frames for the newer versions, as well as larger code that uses all available
registers and then some stack slots for the additive sums, where two registers
would have been enough.

While SSA generates lots of "names", IIUC they should have been collapsed
before outof-ssa.  It does to some extent, if the uses and the definitions are
close enough.  Looking at the tree-dumps, it's one pass that moved all the uses
away from the definitions, tree-reassoc, and no pass later that moved them
"back"; in particular TER (part of outof-ssa) did not.  Adding the option
-fno-tree-reassoc gets rid of most of the regression for this code (and
others).

Having TER changed to, or adding a subpass of outof-ssa, that moves each use
back to its definition, would seem like a better solution than shutting off
tree-reassoc.

This is also a good example of missed post-increment opportunities (all
versions); instead of increasing offsets from a base, there should have been a
single post-incremented register.


-- 
           Summary: [4.0 Regression] SSA names causing register pressure;
                    unnecessarily many simultaneously "live" names.
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: cris-*-* and crisv32-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37916

Reply via email to