This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [pretty-ipa] Substitute non-SSA paramters more when inlining


> 
> This function looks 1) quadratic in the number of function arguments
> 2) wrong once alias information is computed (the stored syms may
> just contain partition tags and not the bare symbols anymore), on
> a-i branch there's no gimple_stored_syms anymore, but instead
> using get_base_address (gimple_get_lhs (stmt)) would be ok here.

I was basically lazy to implement here something when things are going
to change with ai branch.
> 
> I wonder if the above handles parameter with DECL_BY_REFERENCE
> correct at all (or if it is just pessimized).  IIRC for them we get

Hmm, I think decl by reference appears as pointer, so it won't go this
path at all anyway and will be substituted as register.
BTW probably eliminating DECL_BY_REFERENCE is another task for IPA-SRA.
> 
> fn (by_ref *p)
> {
>   T obj = *p;
> ...
> }
> 
> and the interesting thing would be to see if obj is clobbered and if
> not substitute into _that_.
> 
> I would say something like ipa-reference should mark non-escaped
> and not set parameters TREE_READONLY or so [can you split
> the local analysis of a IPA pass to run before early inlining and the
> propagation before late inlining?]

Yes, we can probably do the local analyzis once. I was thinking that it
fits as part of ipa-sra that is anyway responsible for all kind of
function parameter changes and does this analysis. 

It does not fit perfectly since this is transform you can do to
externally visible function too, but ipa-sra already knows how to
work out that the all reads of argument appears before possibly aliasing
stores that is precisely what we need here.
> 
> get_base_address
Huh, thanks :)

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]