Landing: d20adcae36e3

Project / Subsystem

gcc / target/x86

Date

2026-07-21

Author

Richard Biener

Commit

d20adcae36e31cb96a9869566a243e3d6f21ab8d

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
target/x86
patch_id
commit_hash
d20adcae36e31cb96a9869566a243e3d6f21ab8d
source_type
github
headline
Improve x86 horizontal FP instruction costing.
tldr
Fixes x86 combine optimization for horizontal FP add/sub instructions.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • x86
  • optimization
  • sse
  • avx
discussion_id_link
bugzilla_pr
date
2026-07-21T00:00:00.000Z

This commit refines the instruction costing for x86’s horizontal floating-point add and subtract operations, specifically for SSE3 and AVX instructions. By introducing a new cost_special attribute and correctly costing these hadd/hsub operations, the combine optimization pass can now properly identify and recover the single hadd instruction in certain reduction patterns. This addresses issues in test cases previously failing due to incorrect cost estimations.