This is the mail archive of the gcc@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]

Re: Loop optimizer issues


Hello,

I am basically done with the work on rtl-level optimizer.  There are still
some details to do (in fact lot of them, see below), but the basic framework
is finished.  The old loop optimizer is completely eliminated, including
related relicts (loop notes).  I have done some testing (it bootstraps now
on x86, powerpc and ia64) and benchmarking (there are a few regressions
to investigate, see attached results of SPECs).

I think it is a good time to merge it into tree-ssa. I have tested it and there
are no real conflicts, so it should not be problematic.  Since the optimizer
is not sufficiently tested (one of my reasons for merging it into tree-ssa
is also a hope for better testing coverage), I propose to leave out the most
intrusive but basically trivial changes -- elimination of loop notes and old
loop optimizer -- for now and have a flag to switch between the new and the
old loop optimizer (with the old one as default).

More precise description of current status (and especially the problems I am
aware of) follows.

Zdenek

Status (deficiences and missing parts marked by *):
-- old loop optimizer completely replaced
-- loop notes eliminated
     ** cse_around_loop disabled
     ** code preventing cse out of loop disabled
     ** usage for branch prediction in reorg.c & config/m88k/m88k.c
        disabled -- should be replaced by predict.c usage
-- analyses (simple loop analysis, invariant detection, induction variable
   detection) greatly improved
     -- should be easy to adapt for tree-ssa
     ** might be faster, might use less memory (by focusing on relevant
        parts only)
-- most of analyses use intermediate language independent expression
   manipulation utilities
     ** yet another bunch of expression simplification rutines :-(
     ** not used entirely consistently, should be easy to fix when
        trees are interfaced
** handling of machine specific issues, especially usage of subregs,
   is not very comprehensive and not very well tested
** decision heuristics only tuned for x86

Overview:
-- basically corresponds to old optimizer, some parts (doloop, prefetching)
   taken with just minor modifications, the rest rewritten from scratch but
   in technical details inspired by old loop optimizer
     ** for the sake of simplicity a lot of cleanups is left for copy
        propagation & cse, i.e. very few attempts are done to replace regs,
        reuse the old ones, etc.
          ** this decreases quality of debugging information

-- invariant motion
     -- in loop-invariant.c
     ** removal of zero extends from variables set only in zero extend
        missing
     ** memory access motion missing
          -- should be sufficiently handled by gcse load & store motion
  ** moving of libcalls removed
       -- should be unnecessary when invariants motion is done on higher level

-- doloop optimization
     -- in doloop.c
     ** does not attempt to precondition loops
          -- usually unnecessary due to better analysis, easy to add

-- induction variable optimizations
     -- in loop-ivopts.c
     ** produces not very well code for initialization of new bivs
          -- usually later fixed by cse & combine
     ** induction variable elimination is not very sophisticated wrto
        handling possible overflows (i.e. we are too conservative)
     ** ivs that iterate in narrower mode than their base variable are not
        handled

** loop reversal missing
     -- should be handled on higher level

-- unrolling, peeling
     -- unchanged except for using improved analyses

-- unswitching
     ** completely unchanged, includes old heuristics that don't work very
        well

Attachment: CINT2000.020.asc
Description: Text document

Attachment: CFP2000.020.asc
Description: Text document


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