Landing: bc8c49094cdf
Project / Subsystem
gcc / match.pd
Date
2026-07-29
Author
Kyrylo Tkachov
Commit
bc8c49094cdfbb8911d1bdb6fc421c6f56e6422c
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- match.pd
- patch_id
- —
- commit_hash
- bc8c49094cdfbb8911d1bdb6fc421c6f56e6422c
- source_type
- github
- headline
- match.pd: Extend MIN/MAX narrowing through vector casts.
- tldr
- Allows MIN/MAX operations on wide vector types to be narrowed through a cast, simplifying code generation.
- author
- Kyrylo Tkachov
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • vectorization
- • arm
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-29T00:00:00.000Z
This change extends the MIN/MAX narrowing optimization in match.pd to handle vector types. It enables folding comparisons on wide vector types, like v2di, directly into MIN/MAX operations on narrower vector types, like v2si, after a __builtin_convertvector cast. This optimization requires that the wide vector MIN or MAX operation has only one use to avoid introducing redundant operations, significantly simplifying code for operations involving type conversions and MIN/MAX.