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

Adjust OpenMP SIMD call cost model.

This commit adjusts the cost of OpenMP SIMD calls in the GCC cost model, which can influence optimization decisions.

The cost model in GCC didn’t properly account for OpenMP SIMD vector calls, leading to suboptimal optimization decisions. This commit adjusts the cost of these calls, assigning a higher cost that reflects the overhead associated with vectorization. This change can influence the compiler’s decision of when and how to vectorize loops using OpenMP SIMD directives, potentially improving performance.

In Details

This commit modifies ix86_vector_costs::add_stmt_cost in config/i386/i386.cc to adjust the cost of OMP SIMD calls. Previously, these calls were not properly costed, which could lead to the optimizer making incorrect decisions about vectorization. The new cost is set to 10 times the cost of FMA (fused multiply-add) operations, reflecting the overhead of vectorization. This change specifically targets the x86 architecture.

For Context

Modern compilers use cost models to estimate the performance impact of different code transformations. These models help the compiler make informed decisions about which optimizations to apply. OpenMP SIMD directives allow developers to instruct the compiler to vectorize loops, performing the same operation on multiple data elements simultaneously. This commit improves the accuracy of GCC's cost model for OpenMP SIMD calls, which may lead to better vectorization decisions and improved performance of OpenMP-enabled code.

Filed Under: optimizationopenmpsimdcost model