Landing: 6ced85903eb8

Project / Subsystem

gcc / ifcvt

Date

2026-09-06

Author

Kyrylo Tkachov

Commit

6ced85903eb870fbc9710ed4675f5d668336722c

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
ifcvt
patch_id
—
commit_hash
6ced85903eb870fbc9710ed4675f5d668336722c
source_type
github
headline
ifcvt: factor the representable-difference check
tldr
Consolidates a common check for representable differences between constant values in conditional code optimizations.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • ifcvt
  • • refactor
  • • optimization
discussion_id_link
—
bugzilla_pr
—
date
2026-09-06T00:00:00.000Z

The ifcvt pass now uses a new helper function, noce_representable_diff_p, to check if the difference between two constant values in a conditional branch is representable and to truncate it to the correct mode. This logic was previously duplicated in noce_try_store_flag_constants and noce_try_cmove. The change improves code maintainability without altering optimization behavior.