TUESDAY, SEPTEMBER 1, 2026
gcc
AutoFDO: Avoid inserting null PHI profile matches.
Fixes AutoFDO crash by preventing null pointers in profile matching.
This commit resolves an internal compiler error in AutoFDO when processing SPEC CPU 2026. It prevents the insertion of null pointers into the set of matched profile entries, which occurred because PHI nodes lack source locations. This ensures correct profile matching.
In Details
The function_instance::match in auto-profile.cc was inserting null pointers into a hash set when matching profile entries against PHI nodes. Since PHI nodes do not have source locations, lookup_count returns null. This commit modifies the logic to avoid inserting these null entries, fixing an ICE reported with SPEC CPU 2026.
For Context
- AutoFDO
- Automatic Feedback-Driven Optimization. A technique that uses runtime profiling data to guide compile-time optimizations.
- PHI node
- In SSA (Static Single Assignment) form, a PHI node is used to merge values from different control flow paths.
- IPA pass
- Interprocedural Analysis pass. Compiler optimizations that analyze and transform code across function boundaries.
- SPEC CPU 2026
- A suite of benchmarks used to measure computer performance, specifically focusing on CPU-intensive tasks.
- internal compiler error (ICE)
- An error that occurs when the compiler encounters a situation it cannot handle, typically due to a bug in the compiler itself.