> I have not looked at the details. One high level question: this form > seems to only support one indirect target case. LIPO uses TOPN > indirect target profiling (tracking multiple targets), which can be > used by LTO as well (when the topn profiling gets into trunk).
Well, adding multiple direct edges for given call will need extension into cgraph_turn_edge_to_speculative and cgraph_speculative_call_info APIs (to allow multple direct edges) to indirect_info common_target datastructure, to profiling histograms and to the gimple_ic code. Otherwise there is nothing really hard coded about single direct target. How much benefits do you see from having multiple direct targets? I would expect them to be quite quickly disappearing as N increases... How the TOPN profiling counter is implemented? Honza