Landing: ce66e61c785a
Project / Subsystem
gcc / gcc/genextract
Date
2026-08-07
Author
Kyrylo Tkachov
Commit
ce66e61c785a024d217cd71c95fd1eb9aa5f3ea8
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/genextract
- patch_id
- —
- commit_hash
- ce66e61c785a024d217cd71c95fd1eb9aa5f3ea8
- source_type
- github
- headline
- genextract: Drive insn_extract from operand path table
- tldr
- Replaces a large switch statement in insn_extract with a data-driven table lookup, reducing code size.
- author
- Kyrylo Tkachov
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gcc
- • code generation
- • optimization
- • aarch64
- • riscv
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-07T00:00:00.000Z
The genextract tool is responsible for extracting operands from instruction patterns. Previously, it used a large switch statement where each case corresponded to an instruction, leading to excessive labels and large generated code. This commit replaces the switch statement with a data-driven approach. It uses tables to store extraction methods, operand counts, and path strings, allowing insn_extract to walk these paths dynamically. This change significantly reduces the size of the generated code, particularly on architectures like AArch64 and RISC-V.