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

Delay setting of slp_node->data improvements in vectorization.

This commit delays setting `slp_node->data` in vectorizable loads/stores to allow for late adjustments, improving vectorization decisions.

This commit improves the vectorization process by delaying the setting of slp_node->data in vectorizable_load and vectorizable_store functions. This delay allows for late adjustments, such as setting the ls_type, which can influence vectorization decisions. Additionally, a validity check is moved earlier in the process to prevent failures after slp_node->data has been set, leading to more robust vectorization.

In Details

This commit addresses a potential issue in tree-vect-stmts.cc where setting slp_node->data too early inhibits late adjustments like setting ls_type. The patch moves the setting of slp_node->data and SLP_TREE_TYPE down to the success returns, duplicating it. It also moves a failure check earlier to prevent incorrect vectorization. This is related to SLP (Superword Level Parallelism) vectorization.

For Context

Vectorization is a compiler optimization technique that transforms scalar operations into vector operations to improve performance. This commit focuses on improving the internal data structures used during the vectorization process, specifically the slp_node structure. By delaying the initialization of a field within this structure, the compiler gains more flexibility in making decisions about how to best vectorize the code, leading to potentially faster programs.

Filed Under: vectorizationoptimizationslp