> >
> > In ipa-modref I precompute this to map so we do not need to walk all
> > params, but the loop is probably not bad since functions do not have
> > tens of thousdands parameters :)
> 
> The most I have seen is about 70 and those were big outliers.
> 
> I was thinking of precomputing it somehow but for one parameter there
> can be up to param ipa-sra-max-replacements replacements (default 8 -
> and there is another, by default stricter, limit for pointers).  So it
> would have to be a hash table or something like it.

Yep, I think given that we have API, we can play with this later.
> 
> >
> > Can I use it in ipa-modref to discover what parameters was turned from
> > by-reference to scalar, too?
> 
> IIUC, I don't think you directly can, also because for one parameter you
> can have more scalar replacements and the interface needs an offset for
> which to look.  OTOH, if you only care about simple scalars passed by
> reference, then passing zero as offset - and probably adding a flag to
> check there are no replacements at other offsets - would work.  (But
> that information could also be easily pre-computed.)

If parameter is broken up into multipe pieces, I can just duplicate its
ECF flags (if I know that pointers from whole structure does not escape,
neither does pointers from its part). However presently modref compute
noting useful for aggregate parameters (have patch for that but it was
too late in this stage1 to push out everything, so it will come next
stage1).

If parameter is turned from by-reference and possibly offsetted, I can
use the original ECF flag after applying deref_flags translation.
Again it is not problem to multily it if the parameter is stplit into
multiple subparameters.

Honza

Reply via email to