[PATCH] Fix PR35607, another revenge of invariant addresses (ivopts)
Richard Guenther
rguenther@suse.de
Tue Mar 18 10:06:00 GMT 2008
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.
More information about the Gcc-patches
mailing list