GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Add supporting functions for IFN_ASSUME IPA support

Helper functions simplify working with IFN_ASSUME and callback edges in IPA.

This commit introduces several new shorthand functions to aid in working with the IFN_ASSUME construct and associated callback edges within GCC’s Interprocedural Analysis (IPA). These functions, such as callback_ifn_assume_call_p and callback_call_arg_summary, simplify checks and argument remapping logic, making subsequent development related to IPA support for IFN_ASSUME more manageable.

In Details

This patch adds a set of utility functions in callback-info.cc and callback-info.h to streamline IPA work related to IFN_ASSUME calls and callback edges. Functions include callback_call_arg_summary (argument remapping), callback_call_num_args_summary (correct argument count), callback_ifn_assume_call_p (identifies IFN_ASSUME calls), and callback_ifn_assume_call_with_edge_p (identifies IFN_ASSUME calls with an attached cgraph_edge). These are intended to reduce boilerplate in future IPA development for these constructs.

For Context
IPA
Interprocedural Analysis. A suite of compiler passes that analyze and optimize code across function boundaries, rather than within a single function.
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.
callback edge
A callgraph edge representing a function call that is invoked indirectly, often through a function pointer or a callback mechanism.
cgraph_edge
An object representing an edge in GCC's call graph, signifying a call from one function to another.
remapping
Adjusting or transforming data, such as function arguments, to fit a new context or representation.
Filed Under: gccipaoptimizationhelper