Landing: 684d385720cd

Project / Subsystem

gcc / gcc

Date

2026-05-11

Author

Shreya Munnangi

Commit

684d385720cd5d25df8dc69c5281fc0fb9c3bebe

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
684d385720cd5d25df8dc69c5281fc0fb9c3bebe
source_type
github
headline
Simplify RTL bit-flipping operations to use XOR
tldr
The compiler can now simplify certain bit-flipping RTL patterns into XOR operations, improving code generation for RISC-V and potentially other architectures.
author
Shreya Munnangi
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • RISC-V
  • code generation
  • RTL
discussion_id_link
bugzilla_pr
date
2026-05-11T00:00:00.000Z

The compiler can now recognize and simplify RTL patterns that flip specific bits in a register. The optimization applies when the RTL code uses IOR, AND, and NOT operations with constants to isolate and flip a bit. This change improves code generation on RISC-V and may benefit other targets, especially those with sub-word arithmetic. The simplification rewrites the code to use a single XOR operation.