GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc Performance Win

Improve SLP vectorization profitability costing

SLP vectorization now uses a more precise cost model for scheduling, improving profitability analysis.

This patch refines the profitability analysis for SLP (Superword Level Parallelism) vectorization in GCC. It now utilizes the computed schedule location for SLP nodes to determine the containing loop more accurately. This addresses issues where vector constants and externals, scheduled at the region entry, introduced ‘outside’ costs not present in scalar costing. By delaying the assessment of profitability for the entry region and considering total costs, the analysis becomes more reliable.

In Details

This commit modifies vect_bb_vectorization_profitable_p in tree-vect-slp.cc. The Superword Level Parallelism (SLP) vectorizer in GCC identifies straight-line code sequences that can be vectorized. Previously, the profitability analysis used a less precise heuristic for determining the containing loop, especially when dealing with SLP nodes that had 'outside' costs (e.g., from vector constants or externals scheduled at the region entry). This patch introduces a more accurate method by preferring the computed SLP schedule location for loop identification and delays the profitability assessm…

For Context
SLP
Superword Level Parallelism. A compiler optimization technique that vectorizes sequences of identical scalar operations.
vectorization
A compiler optimization that transforms code to operate on multiple data elements simultaneously using wide processor registers (SIMD instructions).
profitability analysis
The process by which a compiler estimates whether applying an optimization will result in a net performance improvement.
scheduling
The process of ordering instructions to optimize execution on the target processor, considering factors like pipeline stalls and register availability.
costing
The mechanism by which a compiler assigns a numerical value representing the resource usage or execution time of an operation or code sequence.
Filed Under: vectorizationoptimizationSLP