Landing: 0b12c7345a94
Project / Subsystem
gcc / rtl-optimization
Date
2026-04-26
Author
Roger Sayle
Commit
0b12c7345a94f11bdacf360d45b847307f9be9cf
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- rtl-optimization
- patch_id
- —
- commit_hash
- 0b12c7345a94f11bdacf360d45b847307f9be9cf
- source_type
- github
- headline
- rtl-optimization: Simplify vec_select of a vec_select.
- tldr
- GCC now simplifies consecutive vector permutations, reducing redundant instructions and improving code generation for vector operations.
- author
- Roger Sayle
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • rtl
- • vectorization
- • code generation
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-04-26T00:00:00.000Z
GCC’s RTL optimizer now simplifies vec_select operations applied consecutively. When the output of one vec_select instruction feeds directly into another, the compiler combines them into a single vec_select with an equivalent permutation. This removes redundant shuffle instructions, leading to more compact and efficient code, particularly for vector-heavy operations. This optimisation avoids a sequence of permutes by collapsing them into a single permute.