GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/tree-vect Performance Win

Compute Full Scalar Statement Coverage During Vectorization

The compiler now computes full scalar statement coverage during basic block vectorization for simpler and more precise live lane determination and scalar costi…

This commit re-purposes STMT_SLP_TYPE to indicate the scalar statement coverage of the vectorized SLP graph in basic block vectorization. This allows for simpler and more precise determination of live lanes and scalar costing, potentially improving the efficiency of vectorized code.

In Details

This commit re-purposes STMT_SLP_TYPE for BB vectorization to indicate the scalar (non-pattern) statement coverage of the vectorized SLP graph. New helper vect_slp_gather_extern_scalar_stmts is introduced. The goal is to simplify determining live lanes and scalar costing.

For Context

SLP vectorization is a compiler optimization technique where sequences of scalar operations are transformed into vector instructions for parallel execution. After vectorizing a code block, it is essential to accurately track which original scalar statements are still relevant. This commit improves how the compiler tracks the coverage of scalar statements after vectorization, leading to more precise live lane detection and better cost analysis, which in turn can improve performance.

Filed Under: optimizationvectorizationSLP