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

SCEV now maintains affine CHRECs in the presence of type conversions.

SCEV analysis is improved to recognize affine loop accesses even with type conversions, enabling better vectorization.

The Scalar Evolution (SCEV) analysis pass is improved to better recognize affine loop accesses when type conversions are involved. This allows the vectorizer to generate more efficient code, avoiding gather operations in favor of linear memory accesses. For example, in loops that access arrays with indices involving both integer and floating-point types, SCEV can now simplify the address calculations, which leads to better performance.

In Details

This commit addresses a limitation in SCEV's handling of type conversions within CHRECs. Specifically, outer casts around CHRECs were preventing the recognition of affine accesses. The fix enables SCEV to analyze these accesses as affine, improving vectorization opportunities. This affects loop optimizations and auto-vectorization, particularly in code involving mixed integer and floating-point arithmetic.

For Context

Scalar Evolution (SCEV) is a compiler analysis technique used to understand how scalar variables change within loops. It represents the value of a variable as a function of the loop iteration number, which enables optimizations like vectorization and loop unrolling. This commit improves SCEV's ability to analyze array accesses inside loops, even when the index calculations involve different data types (e.g., integers and floats). By more accurately tracking how memory addresses are computed, the compiler can generate more efficient machine code, potentially speeding up the program.

Filed Under: optimizationvectorizationlooparm