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

--- Comment #55 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
> Anyway, can we in the spot my patch changed just walk all 
> source->node->callees > cgraph_edges, for each of them find the corresponding 
> cgraph_edge in the alias > and for each walk all the jump_functions recorded 
> and union their m_vr?
> Or is that something that can't be done in LTO for some reason?

That was my fist idea too, but the problem is that icf has (very limited)
support for matching function which differ by order of the basic blocks: it
computes hash of every basic block and orders them by their hash prior
comparing. This seems half-finished since i.e. order of edges in PHIs has to
match exactly.

Callee lists are officially randomly ordered, but practically they follows the
order of basic blocks (as they are built this way).  However since BB orders
can differ, just walking both callee sequences and comparing pairwise does not
work. This also makes merging the information harder, since we no longer have
the BB map at the time decide to merge.

It is however not hard to match the jump function while walking gimple bodies
and comparing statements, which is backportable and localized. I am still
waiting for my statistics to converge and will send it soon.

Reply via email to