Landing: e07e140680c7

Project / Subsystem

gcc / riscv

Date

2026-07-03

Author

Jeff Law

Commit

e07e140680c717cfc59a11bf2287ff6433ebddd2

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
riscv
patch_id
commit_hash
e07e140680c717cfc59a11bf2287ff6433ebddd2
source_type
github
headline
RISC-V: Improve IOR/XOR synthesis for expensive constant cases
tldr
RISC-V backend improves constant synthesis for IOR/XOR operations to better utilize C extension instructions.
author
Jeff Law
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • riscv
  • optimization
  • compiler
discussion_id_link
bugzilla_pr
date
2026-07-03T00:00:00.000Z

The RISC-V backend now uses riscv_integer_cost instead of riscv_const_insns for synthesizing IOR and XOR operations with expensive constants. This change enables the use of C extension instructions like XNOR, ORN, and ANDN, which can improve code generation when constants require more than three instructions to synthesize, preventing previously observed suboptimal code by distinguishing costs.