https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103227

--- Comment #7 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to hubicka from comment #5)
> > I like the idea of transformation phases better than putting
> > everything into tree-inline (and by extension ipa-param-manipulation)
> > but perhaps we have to do aggregate constant replacements there too?
> 
> So the situation is that we inline call A->B (where both A and B are
> clones of the main function) and while we place uses of the constant
> parmater in A we miss replacement in B because transform is not run on
> it.

No, we miss it everywhere, even in A (see that the code above is from
BB 2) or probably also without any cloning whatsoever. This happens
when IPA-SRA does its thing on the same parameter on which IPA-CP
decided to propagate aggregate constants.

In the IPA analysis stage (which creates the virtual clones), IPA-CP
runs before IPA-SRA.  But in the transformation phase, it is
apparently the other way round - well, not exactly, IPA-SRA does not
formally have a transformation phase, it happens as part of
tree_function_versioning, but the effect is the same.

> 
> I think proper solution here (discussed also few years ago) is to keep
> the optimization summaries and teach value numbering to look up the
> constant from the summary.
> 

Yes, but this is another (but different) problem that we probably also
should try to solve now.

Reply via email to