Landing: e03a2c452764

Project / Subsystem

gcc / postreload

Date

2026-09-19

Author

Dominic P

Commit

e03a2c4527648bd5bc21a452a1e44d51ec3c2f89

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
postreload
patch_id
—
commit_hash
e03a2c4527648bd5bc21a452a1e44d51ec3c2f89
source_type
github
headline
Postreload: Recover branch condition through cc register
tldr
Improves CSE analysis for branches by recovering condition codes from the cc register.
author
Dominic P
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • compiler
  • • cse
discussion_id_link
—
bugzilla_pr
—
date
2026-09-19T00:00:00.000Z

This commit enhances the postreload pass to recover branch conditions even when they are not directly carried by the jump instruction itself. Previously, optimization was limited to targets where the comparison was embedded in the jump (like RISC-V or MIPS). The change uses get_condition to find the comparison in the cc register, enabling common subexpression elimination for more cases. This optimization is guarded to prevent performance regressions, ensuring it’s only applied when beneficial.