This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] More aliasing fixes
On Wed, 2003-12-17 at 07:08, Jan Hubicka wrote:
> I see, this makes it more Morgan like.
>
How so? It was just a bug fix :)
> We still don't have separate tag
> for each load, instead we take advantage of the fact that pointers with
> same properties will have equivalently looking tags, right?
>
Yes. Pointers whose pointed-to types have the same alias set will have
the same memory tag (if they have been dereferenced).
> I've been considering the idea of making the whole thing more Morgan
> like - ie making may_alias arrays transitive and always emit one VUSE
> for loads (currently we VUSE all aliased tags, right?). Do you see some
> fundamental problem with this idea?
>
It's a possibility, yes. If you want loads to have a single VUSE, you
will cause stores to aliased variables to have 2 VDEFs and loads from
aliased variables to have 2 VDEFs.
foo (int i)
{
int a, b, c;
p = (i > 10) ? &a : (i < 20) ? &b : &c;
Current New
*p = ... <-- 3 VDEFs 1 VDEF
a = ...; <-- 1 VDEF 2 VDEFs
b = ...; <-- 1 VDEF 2 VDEFs
c = a + b; <-- 1 VDEF, 2 VUSEs 2 VDEFs, 4 VUSEs
*p = a - c; <-- 3 VDEFs, 2 VUSEs 1 VDEF, 4 VUSEs
return c; <-- 1 VUSE 2 VUSEs
14 vops 18 vops
}
With the current implementation we'd generate 14 vops, the new one would
generate 18 vops. But we would have to experiment with real code. I
can see definite advantages to the new scheme in pointer-heavy code.
Diego.