Landing: a80a8b2533c2

Project / Subsystem

gcc / gcc

Date

2026-04-27

Author

Jeff Law

Commit

a80a8b2533c22a698f21d1ec8f5e5cbe3918671c

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
a80a8b2533c22a698f21d1ec8f5e5cbe3918671c
source_type
github
headline
Detect more czero opportunities on RISC-V
tldr
The RISC-V backend now recognizes more cases where `czero.eqz` can replace a sequence of `sgt`, `snez`, and `and` instructions.
author
Jeff Law
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • risc-v
  • optimization
  • code generation
discussion_id_link
bugzilla_pr
date
2026-04-27T00:00:00.000Z

The RISC-V backend now recognizes more cases where a sequence of sgt, snez, and and instructions can be replaced with the czero.eqz instruction. By generalizing existing patterns to accept both NE and EQ forms and handling commutative AND operations, the compiler can now generate more efficient code sequences when the Zicond extension is enabled. This change improves code generation efficiency in specific scenarios.