Landing: eb311f861255
Project / Subsystem
gcc / tree-optimization
Date
2026-08-04
Author
liuhongt
Commit
eb311f861255ae1fcaafa3454d4d1d6f1da07497
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- tree-optimization
- patch_id
- —
- commit_hash
- eb311f861255ae1fcaafa3454d4d1d6f1da07497
- source_type
- github
- headline
- tree-optimization: Fold sign-changing conversions in IVOPTS
- tldr
- Improved loop invariant code motion by folding sign-changing conversions and handling modular arithmetic.
- author
- liuhongt
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • tree-optimization
- • loop-optimization
- • performance
- • code-size
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-04T00:00:00.000Z
This commit enhances the Loop Invariant code Motion (IVOPTS) pass by enabling the ‘ranger’ analysis to fold sign-changing conversions and modular arithmetic into exact arithmetic. This resolves a code-size regression caused by canonicalizing signed arithmetic to unsigned, which previously hid loop invariant terms. The improvements allow for better affine decomposition and can reduce loop-bound spills, leading to performance gains on various architectures.