GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
risc-v Performance Win

RISC-V enables fusion of adjacent and post-indexed load/store pairs

RISC-V target adds new macro-fusion capabilities for adjacent and post-indexed load/store operations, improving instruction-level parallelism.

GCC introduces several new macro-fusion capabilities for the RISC-V architecture. These enhancements allow the compiler to combine adjacent floating-point and integer load/store pairs, as well as post-indexed load/store operations, into single instructions. The changes also generalize the recognition of pre-indexed load operations. While these fusions are disabled by default and have their checks XFAILed, they pave the way for future performance improvements by enabling the processor to execute more work per instruction.

In Details

This set of commits introduces new RISC-V specific macro-fusion rules within the riscv-fusion.cc pass. It expands the capabilities of the instruction scheduler by recognizing patterns for adjacent load/store pairs (both ascending and descending, for integer and floating-point types), post-indexed load/store operations, and a specific SRLI+ADD pattern. These new rules are registered in riscv_fusion_table and riscv_fusion_pairs enum, and leverage existing helpers like riscv_fusion_mem_rules and riscv_fuse_indexed_mem_p. The intent is to increase instruction-level parallelism by fusing…

For Context
macro-fusion
A compiler optimization technique where multiple independent machine instructions are combined into a single, more complex instruction. This can improve performance by reducing instruction fetch, decode, and execution overhead.
RISC-V
An open-standard Instruction Set Architecture (ISA) based on Reduced Instruction Set Computer principles. GCC supports various RISC-V profiles and extensions.
load/store pair
Consecutive load or store instructions that operate on adjacent memory locations and can potentially be fused into a single instruction, especially when they share a base address and have regular offsets.
post-indexed
A memory addressing mode where the base address is used for the memory access, and then the base address is updated (e.g., incremented or decremented) after the access.
pre-indexed
A memory addressing mode where the base address is updated first (e.g., incremented or decremented), and then the updated address is used for the memory access.
RTL
Register Transfer Language, an intermediate representation used within GCC. It describes operations on registers and memory at a level suitable for instruction scheduling and optimization.
XFAIL
A test directive in GCC's testsuite indicating that a test is expected to fail for a specific reason (e.g., a feature is not yet fully supported or enabled). This allows the test to be included without causing the overall test suite to fail.
Filed Under: risc-voptimizationinstruction fusion