GSoC: possible IPA-ICF project direction
Discussion on using separate bodies for IPA-ICF as a potential GSoC project.
Richard Biener acknowledges Rohith Kapelli’s findings regarding IPA-ICF and separate bodies, suggesting the implementation of separate bodies at the cgraph level as a viable GSoC project. He indicates that Honza or Martin would be suitable mentors for such a project.
- proposer
Suggests that implementing separate bodies at the cgraph level, with one body for inlining and another for offline code generation, could be a suitable GSoC project and identifies potential mentors.
“Yes, that's what I expected - the separate body case only allows some cases of mismatches to prevail. Implementing separate bodies on the cgraph level, one body for inlining, one for offline code generation, is another thing that might qualify for a GSoC project. Honza or Martin would be to sign-off on that though, as they are the most natural mentors for this.”
- contributor
Reports on testing the separate-body idea with reduced test cases for PR119006 and PR123227, detailing observations on code generation when the leader's out-of-line body is inlined or not, and how ICF handles losing bodies.
“Hi Richard, I looked into the separate-body idea using reduced testcases for PR119006 and PR123227, using trunk from 3 September, before the PR119006 and PR123227 fixes. For PR119006, the current merge is safe when the leader's out-of-line body is not inlined, but inlining the leader into the other caller produces the wrong code. Defining the two structs in the opposite order swaps the lea…”
Technical Tradeoffs
- Implementing separate bodies for IPA-ICF could improve optimization accuracy for certain cases but might increase compiler complexity and compilation time.
In Details
This discussion concerns the GCC Intermediate Representation (IR) and optimization passes, specifically related to Interprocedural Analysis (IPA) and Identical Code Folding (ICF). The core issue is handling function bodies that are identical but might be emitted separately for inlining versus non-inlining (out-of-line) code generation. The potential GSoC project would involve modifying the cgraph level to manage these distinct bodies.
- IPA
- Interprocedural Analysis, a compiler optimization technique that analyzes program behavior across function calls to optimize the entire program.
- ICF
- Identical Code Folding, an optimization that detects and merges identical functions or code sections to reduce code size and improve cache performance.
- cgraph
- GCC's internal representation for call graphs, used to model function calls and their relationships.
- GSoC
- Google Summer of Code, an annual program that offers stipends to students who contribute to open-source projects.