Landing: 03fcac336e04

Project / Subsystem

gcc / gcc/fold-mem-offsets

Date

2026-04-28

Author

Philipp Tomsich

Commit

03fcac336e04ba2cd57495a47534accc145e160e

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/fold-mem-offsets
patch_id
commit_hash
03fcac336e04ba2cd57495a47534accc145e160e
source_type
github
headline
Fold-mem-offsets: Move RISC-V size-optimization workaround to the backend.
tldr
A workaround for RISC-V size optimizations has been moved from the fold-mem-offsets pass to the RISC-V backend, improving performance for other targets.
author
Philipp Tomsich
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • RISC-V
  • optimization
  • code size
discussion_id_link
bugzilla_pr
date
2026-04-28T00:00:00.000Z

A target-specific workaround in the fold-mem-offsets pass, which skipped basic blocks optimized for size to avoid conflicts with RISC-V’s shorten-memrefs pass, has been moved to the RISC-V backend. This change allows other targets to benefit from offset folding in size-optimized blocks, while preserving the original RISC-V behavior by disabling fold-mem-offsets when optimizing for size with compressed instructions enabled.