IPA: Adjust fnsummary for internal callback edges
IPA summary generation now correctly handles internal callback edges.
This commit adjusts the IPA function summary generation to correctly process internal callback edges. It guards against missing callgraph edges for IFN_ASSUME calls and special-cases summary generation to account for the fact that internal callback edges lack a callback-carrying edge. This ensures accurate size and time information (both 0) is recorded.
In Details
The ipa-fnsummary pass previously assumed regular callback edges would always have a corresponding callgraph edge available for summary generation. This commit adds an assertion to catch unexpected missing edges, specifically for internal IFN_ASSUME calls, and modifies the summary generation logic to correctly handle these internal callback edges which do not have a callback-carrying edge, setting their size and time to 0.
- IPA
- Interprocedural Analysis. A suite of compiler passes that analyze and optimize code across function boundaries, rather than within a single function.
- fnsummary
- A data structure within GCC's IPA passes that summarizes information about function calls and their callgraph edges for interprocedural analysis.
- internal callback edge
- A callgraph edge representing a call to an outlined function (like IFN_ASSUME bodies) that is not directly visible in the main call graph, differing from regular callback edges.
- IFN_ASSUME
- A special function or construct used in GCC, often related to outlining or assumptions made during interprocedural analysis, particularly for handling callback-like scenarios.