Add inverted_mapping field to callback_info
Callback_info gains a new field to map call arguments back to callback parameters, aiding interprocedural analysis.
A new field, inverted_mapping, has been added to the callback_info structure. This field provides a reverse mapping, allowing developers to find the index of a callback’s parameter given an argument’s index. This is particularly useful for interprocedural analysis (IPA) pass, such as IPA-SRA, to associate argument flows with a callee’s parameters.
In Details
This change introduces inverted_mapping to callback_info, complementing the existing arg_mapping. While arg_mapping translates callback parameters to call arguments, inverted_mapping provides the reverse lookup. This is critical for passes like IPA-SRA which need to track data flow across function calls by associating argument values with callee parameters. The invert_arg_mapping function computes this new mapping.
- callback_info
- A data structure used in GCC to store information about function callbacks, including parameter mapping.
- IPA-SRA
- Interprocedural Scalar Replacement of Aggregates. An optimization pass in GCC that replaces scalar aggregate accesses with scalar variables to enable further optimizations.
- interprocedural analysis (IPA)
- Analysis that considers the interactions between multiple procedures (functions) in a program, rather than analyzing each procedure in isolation.
- auto_vec
- A dynamic array or vector type used within GCC, likely for storing sequences of elements.