Landing: 7d84a357cfaa

Project / Subsystem

gcc / x86_cse

Date

2026-05-08

Author

H.J. Lu

Commit

7d84a357cfaa3d9ff2cc600a3c145780d37b6aed

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
x86_cse
patch_id
commit_hash
7d84a357cfaa3d9ff2cc600a3c145780d37b6aed
source_type
github
headline
x86_cse: Check CONST0_RTX and CONSTM1_RTX During Vectorization
tldr
The x86 CSE pass now correctly handles CONST0_RTX and CONSTM1_RTX for constant vectors during vectorization, improving code generation.
author
H.J. Lu
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • x86
  • cse
  • vectorization
  • optimization
discussion_id_link
bugzilla_pr
date
2026-05-08T00:00:00.000Z

This commit fixes an issue in the x86 common subexpression elimination (CSE) pass where CONST0_RTX and CONSTM1_RTX were not correctly handled for constant vectors. The fix ensures that during vectorization, redundant vector loads are properly replaced when the source is a constant vector of zeros or minus ones. This leads to better code generation by avoiding unnecessary computations.