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

Simplify API for estimating peeling costs in vectorizer.

GCC simplifies the API and implementation of the function estimating loop peeling costs in the vectorizer.

This commit simplifies the API and implementation of vect_get_known_peeling_cost in GCC’s vectorizer. The changes reflect the actual usage of the function, which primarily involves summing scalar loop copies using builtin_vectorization_cost. This reduces overhead by avoiding the unnecessary use of record_stmt_cost.

In Details

Loop peeling is a vectorization technique used to handle alignment issues. vect_get_known_peeling_cost estimates the cost of peeling. This commit simplifies the function's API and implementation to better reflect its actual usage by the callers. It streamlines the cost estimation process by focusing on the summation of scalar loop copies using builtin_vectorization_cost.

For Context

Loop vectorization is a compiler optimization to convert loops that operate on scalar data into loops that operate on vectors. Loop peeling involves executing the first few iterations of a loop separately to enable vectorization by aligning the data. This commit simplifies the implementation of a function that estimates the cost of loop peeling, improving the efficiency of the vectorization process.

Filed Under: vectorizationoptimizationrefactoring