Landing: 4a97237ac390

Project / Subsystem

gcc / ext-dce

Date

2026-03-20

Author

Philipp Tomsich

Commit

4a97237ac39074b1083df4490d0fa6815c2ed595

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
ext-dce
patch_id
commit_hash
4a97237ac39074b1083df4490d0fa6815c2ed595
source_type
github
headline
ext-dce: Narrow Sign-Extending Loads to Zero-Extending When Upper Bits Are Dead
tldr
The ext-dce pass now optimizes sign-extending loads to zero-extending loads when the upper bits are unused, improving code generation.
author
Philipp Tomsich
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • dead code elimination
  • aarch64
  • risc-v
discussion_id_link
bugzilla_pr
date
2026-03-20T00:00:00.000Z

The ext-dce (extended dead code elimination) pass now optimizes sign-extending loads into zero-extending loads when it can prove that the upper bits of the loaded value are not used. This optimization applies to memory operands (loads). By converting, for example, a sign-extending lh to a zero-extending lhu on RISC-V, the compiler can generate more efficient code sequences.