Landing: e891ad2e77a5

Project / Subsystem

gcc / tree-optimization

Date

2026-08-18

Author

Richard Biener

Commit

e891ad2e77a5373d62af39c8b5f815993fccf253

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
e891ad2e77a5373d62af39c8b5f815993fccf253
source_type
github
headline
Assign vertex weight to all SLP nodes, including those without representatives
tldr
SLP optimization now assigns vertex weights to all nodes, ensuring consistent cost analysis even for nodes without a representative.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • tree-optimization
  • • vectorization
  • • cost-model
discussion_id_link
—
bugzilla_pr
—
date
2026-08-18T00:00:00.000Z

This change ensures that all nodes within GCC’s SLP (Straight-Line-Progression) vectorization process are assigned a vertex weight, which is used for cost-based analysis. Previously, nodes lacking an SLP_TREE_REPRESENTATIVE might not have had their weights initialized, potentially leading to incorrect cost estimations. The vect_slp_node_weight function is updated to use the region entry block for context when a representative is absent, and vect_optimize_slp_pass::start_choosing_layouts now unconditionally assigns a vertex weight to all nodes.