This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR optimization/13653
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: ebotcazou at libertysurf dot fr (Eric Botcazou)
- Cc: law at redhat dot com, kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner), gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Jun 2004 14:56:10 +0100 (BST)
- Subject: Re: [PATCH] Fix PR optimization/13653
> > Not recording the GIV if it is marked TREE_READONLY seems relatively
> > simple and I would expect it to not muck things up.
> I think this would prevent BIV elimination in some cases, especially for C++.
> That's probably what was concerning Joern.
There are actually three issues.
- The first one is indeed about missing the GIV reduction and BIV
elimination itself, as you mentioned.
- Second, there is the point that the code should make sense. It's
just as easy to reset the unchanging bit as to avoid reducing the giv,
and there is no actual meaning to the unchanging bit except that the
pseudo is just set once. When someone later uses this code a starting
point for another optimization, or for code that has to come up with a
heuristic prediction if giv reduction will be done, handling of
'unchanging' givs might be more important in this new code than it is
now. Preventing an optimization just because we have this funny
notion of an unchainging giv is just backwards, and like it or not,
such awkward code has a tendency to spread and make the compiler
harder not only perform worse, but also harder to understand.
- Third, early code transformations that want to predict if a giv
reduction is likely to be done have one more thing to worry about if
the unchanging bit can prevent a giv reduction.