FRIDAY, AUGUST 7, 2026
gcc Performance Win
Convert float-to-float casts to sub-ranges.
Float-to-float casts are converted to sub-ranges for more precise analysis.
This commit refactors floating-point to floating-point casts to operate on sub-ranges, improving the precision of range analysis. By converting each sub-range individually and then combining the results, the compiler can better understand the possible output values of such casts. A new test case is included to validate this change.
In Details
Within range-op-float.cc, the operator_cast implementation for float-to-float conversions now decomposes the operation by processing each sub-range and uniting the outcomes. This enhancement to the floating-point range analysis aims to provide a more accurate representation of cast behavior, potentially unlocking further optimizations.
For Context
- sub-ranges
- A way to represent a set of possible floating-point values within a range analysis. Instead of a single value, a sub-range can represent a contiguous set of values.
- range analysis
- A static analysis technique used by compilers to determine the possible range of values a variable or expression can take during program execution. This information aids in optimizations and error detection.