Landing: de7756c90f3b

Project / Subsystem

gcc / gcc/tree-optimization

Date

2026-06-10

Author

Richard Biener

Commit

de7756c90f3bebdf02492842ec355d7e18745e7b

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/tree-optimization
patch_id
commit_hash
de7756c90f3bebdf02492842ec355d7e18745e7b
source_type
github
headline
Optimization for left shifts by additions sets correct vector type
tldr
GCC's tree vectorizer now correctly handles vector types when optimizing left shifts implemented as additions, improving code generation accuracy.
author
Richard Biener
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • vectorization
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-06-10T00:00:00.000Z

This commit corrects an issue in GCC’s tree vectorizer where internally generated statements for left shifts by additions failed to specify the correct vector type. The synth_lshift_by_additions and apply_binop_and_append_stmt functions now ensure the proper vector type is set on the pattern statements. This fix improves the accuracy of vectorized code generated by the compiler, avoiding potential type-mismatches and incorrect optimizations.