Landing: 8b97248edd8f

Project / Subsystem

gcc / gcc/tree-optimization/vect

Date

2026-05-12

Author

Lili Cui

Commit

8b97248edd8f2716d451bfeb369540c0d5338a5d

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/tree-optimization/vect
patch_id
commit_hash
8b97248edd8f2716d451bfeb369540c0d5338a5d
source_type
github
headline
Allow Commutative Operand Swap for IFN in SLP Reduction
tldr
GCC can now swap commutative operands in SLP vectorization for internal functions (IFN) like `.COND_ADD`, improving vectorization of code generated by if-conve…
author
Lili Cui
outcome
committed
performance_win
true
breaking_change
false
series_id
gcc:tree-optimization/vect: allow commutative operand swap for ifn in slp reduction
series_parts
[]
tags
  • optimization
  • vectorization
  • slp
discussion_id_link
bugzilla_pr
date
2026-05-12T00:00:00.000Z

GCC’s SLP vectorizer now recognizes commutative operand swaps for internal functions (IFN) generated during if-conversion, such as .COND_ADD. Previously, the vectorizer only recognized commutative swaps for tree_code operations (e.g. PLUS_EXPR), leading to failures when reduction operands appeared in different commutative positions. This change improves performance (7.1% on EMR, 2.48% on Znver5 for 731.astcenc_r with -Ofast).