[Mono-devel-list] Alias analysis

Ben Maurer bmaurer at ximian.com
Thu Jan 27 07:26:33 EST 2005


On Thu, 2005-01-27 at 11:23 +0100, Massimiliano Mantione wrote:
> But for deadce without SSA I really wanted to have more accurate
> liveness information, and I have the suspect that this would be
> useful also for the new regalloc, so I still think this kind of
> "alias tracker" is worth doing.

Here, I would say `just do deadce on variables that don't get the
address taken'.

> > Maybe some effort should be made to make the valuetype operations
> > "smarter" for example in this code:
> > 
> > struct X {
> > ...
> > }
> > 
> > if (foo) {
> >     X x = new X (blah);
> >     // do stuff with x
> > }
> > 
> > if (bar) {
> >     X y = new X (baz);
> >    // do stuff with y
> > }
> > 
> > We could assign x and y the same stack slot, even though ldarga is
> > probably executed on both of them.
> 
> If I understood what you mean, to solve this you need accurate
> liveness information, so that you know that when you assign 'y',
> 'x' is already dead, so its storage on the stack can be recycled.
> And this is also why I think that improving liveness will help
> the regalloc...
> 
> Extending my approach to handle case [c] in the case of value
> types would give you exactly this ;-)
> (if you look at my explanation, you'll see that I say that in case
> [c] there are subcases, but for now I was ignoring them)


I think the simpler way to do it is to avoid looking at

blah.X as

ldloca blah
ldfld X

and as something like:

ldloc blah
ldfld X

COnsidering loading a value type field as taking the address of a
variable isn't good for the jit.

-- Ben




More information about the Mono-devel-list mailing list