Landing: efeeb755192c

Project / Subsystem

gcc / gcc/vectorization

Date

2026-04-28

Author

Richard Biener

Commit

efeeb755192cb03e5b24b44cb4fb563c11626a8e

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/vectorization
patch_id
commit_hash
efeeb755192cb03e5b24b44cb4fb563c11626a8e
source_type
github
headline
Improve masked main loop selection for x86 vectorization.
tldr
The compiler now prefers masked main loops when they reduce epilogue iterations on x86, preventing performance regressions.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • gcc
  • vectorization
  • x86
  • optimization
discussion_id_link
bugzilla_pr
date
2026-04-28T00:00:00.000Z

This commit overrides vector_costs::better_main_loop_than_p to prevent regressions in gcc.target/i386/vect-partial-vectors-2.c when --param ix86-vect-compare-costs=1 is enabled. The change prioritizes masked main loops (where AVX masking is used) if they minimize the need for vector and scalar epilogue iterations, specifically when a non-masked main loop cannot be vectorized. This is a heuristic that favors smaller icache footprint on x86 for loops with few iterations.