Landing: 1bf9bb5f1c5b

Project / Subsystem

gcc / simplify-rtx

Date

2026-07-01

Author

Roger Sayle

Commit

1bf9bb5f1c5bdaf8f96c64fbf2a081aaaa2b9b2f

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
simplify-rtx
patch_id
commit_hash
1bf9bb5f1c5bdaf8f96c64fbf2a081aaaa2b9b2f
source_type
github
headline
simplify-rtx: Optimize nested vec_merge operations on x86
tldr
Simplifies sequences of vec_merge operations involving repeated operands into a single instruction.
author
Roger Sayle
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • rtl
  • vectorization
  • x86
discussion_id_link
bugzilla_pr
date
2026-07-01T00:00:00.000Z

This commit introduces a new optimization in simplify-rtx.cc that simplifies specific sequences of vec_merge operations. The optimization targets cases where a vec_merge is applied to the result of another vec_merge that uses a duplicated operand. For example, (vec_merge (vec_merge a b m) a n) can now be simplified to (vec_merge a b (m|~n)). This allows GCC to generate more efficient code, particularly for vector types on x86, by collapsing multiple vector manipulation instructions into a single, more powerful one.