Hello,

On Fri, May 20 2022, Erick Ochoa via Gcc wrote:
> Hi,
>
> I'm working on a pass that looks into the estimated values during ipa-cp
> and stores them for a later analyses/pass. I would like to store the real
> arguments' estimates in a cgraph_edge::call_stmt or somewhere else that
> makes similar sense. (Note, this is different from the formal parameters'
> estimates which can be found in the lattice print out of ipa-cp).

the statement is not the right place to store such pass-specific
information, for reasons you described and more (especially simple
memory use efficiency).

Instead they should be placed into an "edge summary" (also sometimes
called "call summary"), a structure similar to ipa_edge_args_sum (in
ipa-prop.h and ipa-prop.cc).  Unlike ipa_edge_args_sum, which is
allocated at analysis phase, then streamed out and in in case of LTO,
and used thrown away during the IPA analysis phase, your summary would
need to be allocated at IPA analysis time, then streamed out in
ipcp_write_transformation_summaries, streamed in in
ipcp_read_transformation_summaries so that they can be used in the
transformation phase.

Usually a simple implementation of the duplication hook of an edge
summary is enough for the data to survive cloning and inlining and the
like.

Martin

Reply via email to