Landing: cd962857ea3d

Project / Subsystem

gcc / tree-optimization

Date

2026-08-18

Author

Richard Biener

Commit

cd962857ea3d8db2e7ed08f98df4152e7739e8cd

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
cd962857ea3d8db2e7ed08f98df4152e7739e8cd
source_type
github
headline
Avoid setting SLP_TREE_REPRESENTATIVE for vector permute operations
tldr
Vector SLP optimization now correctly handles permute nodes by not setting SLP_TREE_REPRESENTATIVE.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • tree-optimization
  • • vectorization
  • • refactor
discussion_id_link
—
bugzilla_pr
—
date
2026-08-18T00:00:00.000Z

This commit refactors GCC’s SLP (Straight-Line-Progression) vectorization pass to consistently avoid setting the SLP_TREE_REPRESENTATIVE flag for VEC_PERM_EXPR nodes. Several functions within tree-vect-slp.cc and tree-vect-slp-patterns.cc have been adjusted to either not set this flag or to correctly handle cases where it is not set for permute operations. This change ensures that the SLP analysis and optimization of vector permutations are handled more robustly, preventing potential issues during CSE (Common Subexpression Elimination) and analysis.