Landing: 9edd8aa65a3c

Project / Subsystem

gcc / vect

Date

2026-09-28

Author

Dominic P

Commit

9edd8aa65a3c2fb813412971c00981d6d466ab0f

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
vect
patch_id
—
commit_hash
9edd8aa65a3c2fb813412971c00981d6d466ab0f
source_type
github
headline
vect: Widen loop-invariant operands using their narrowest valid range
tldr
Vectorizer now uses narrow ranges of loop-invariant operands to enable more widening operations.
author
Dominic P
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • vectorization
  • • optimization
  • • performance
discussion_id_link
—
bugzilla_pr
—
date
2026-09-28T00:00:00.000Z

The GCC vectorizer can sometimes widen operands to match the result type, improving instruction efficiency. Previously, this widening was blocked if a loop-invariant operand had a range that didn’t fit within the result’s type, even if the operand’s actual range was much narrower. This change modifies the vectorizer to query the precise range of loop-invariant operands and use the narrowest type that can hold that range. This allows widening to occur more often, as seen in an x265 optimization that reduced instruction count.