On Sat, 2006-01-21 at 15:33 +0100, Jan Hubicka wrote:
> > One way to avoid this restriction would be to extend RTL alias
> > analysis to not be strictly type based.  In particular, we could
> > extend it to know that a particular stack slot has a range of alias
> > sets.  And we would then have to know whether a particular pointer
> > could possibly point to that stack slot.  However, in general, I
> 
> This would not work in general.  You can teach RTL AA to properly answer
> question "can pointer X point to slot Y?" by knowing that slot Y can
> have two different alias sets, but you need to answer also question "can
> pointer X point to same place as pointer Y" when both pointers might
> possibly point to shared slot Z.  So if you introduce sharing and you
> want to do type based AA on pointers, you would have to somehow adjust
> type aliasing rules so any two types that can point to same place in
> shared stack slot would be now believed to be conflicting.  This is
> rather nasty I would say.

Right, which is why, if such a thing was true, you don't do it by
modifying the type-based rules directly.

You simply have some external way of saying "You think these don't point
to the same place, but they really do, trust me".

RTL-AA isn't actually as heavily type based as we make it seem. 

I'd venture, based on experience and the statistics of how effective
TBAA is on other compilers that have been published, that TBAA answers
roughly 10% of queries that simple disambiguation doesn't resolve
(Simple being base + offset and friends).

Intraprocedural points-to generally isn't more than 10% either, so this
isn't a dig on TBAA  :P.

Something to keep in mind when thinking of solutions.

--Dan



Reply via email to