Landing: 7943b5fe9089

Project / Subsystem

gcc / middle-end

Date

2026-08-12

Author

Kyrylo Tkachov

Commit

7943b5fe90891fb87806b1ed97a06bd38e62aab7

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
middle-end
patch_id
—
commit_hash
7943b5fe90891fb87806b1ed97a06bd38e62aab7
source_type
github
headline
middle-end: Try intermediate types for widening sums
tldr
Vectorizer now considers intermediate types for widening sum patterns, improving performance for reductions on AArch64 SVE.
author
Kyrylo Tkachov
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • vectorization
  • • optimization
  • • aarch64
  • • SVE
  • • reduction
discussion_id_link
—
bugzilla_pr
—
date
2026-08-12T00:00:00.000Z

The vectorizer’s widening sum pattern recognition has been improved to consider intermediate integer types, not just the scalar input type. This allows it to utilize target-specific instructions like AArch64 SVE’s VNx2DI <- VNx8HI widening sum, which were previously missed if the input was, for example, VNx8QI. The change enables more efficient code generation for reductions, converting operations that previously required multiple loop iterations into single dot product instructions.