This is the mail archive of the gcc-patches@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: [PATCH] Fix PR35607, another revenge of invariant addresses (ivopts)


On Mon, 17 Mar 2008, Diego Novillo wrote:

> On 03/17/08 10:46, Richard Guenther wrote:
> 
> > Otherwise TREE_INVARIANT is suspiciously
> > unused and we might be able to get rid of it completely (and maybe
> > replace it by marking possibly-invariant address DECLs to avoid
> > the costly checks there).
> 
> You mean a caching mechanism for is_gimple_invariant_address?  I guess, but
> first we'd have to find a significant slowdown with your patch. Caching
> invariantness is what brought us to this point.

Yes, I mean caching only of the leaf part, that is

  if (DECL_P (op)
      && (staticp (op)
          || decl_function_context (op) == current_function_decl
          || (TREE_CODE (op) == VAR_DECL
              && DECL_THREAD_LOCAL_P (op))))
    return true;

but - looking at the implementation of staticp we should better inline it
(it contains lots of irrelevant code for the case we use it).

> > 2008-03-17  Richard Guenther  <rguenther@suse.de>
> > 
> >  * tree-gimple.h (is_gimple_invariant_address): Declare.
> >  (is_gimple_constant): Likewise.
> >  * tree-gimple.c (is_gimple_constant): New function.
> >  (is_gimple_invariant_address): Likewise.
> >  (is_gimple_min_invariant): Implement in terms of is_gimple_constant
> >  and is_gimple_invariant_address.
> >  * tree-ssa-loop-niter.c (expand_simple_operations): Revert
> >  previous change.
> 
> Looks OK now.

Bootstrapped and tested ok, I'll inline staticp here and re-do
the testing.

Ok if that passes?

Thanks,
Richard.


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