GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
vect

Vectorizer utilizes non-wrapping data-reference bounds for loop analysis.

The vectorizer now requests non-wrapping bounds from data-reference analysis to refine loop iteration assumptions.

This commit enables the vectorizer to leverage non-wrapping bounds derived from data-reference (DR) analysis. It integrates this information by collecting the minimum bounds and ANDing a new assumption (niter < bounds_min) into the existing iteration assumptions. This change also involves reordering DR analysis to occur earlier in the loop analysis pipeline, allowing for better reuse of iteration count checks and dumps.

In Details

This patch series introduces non-wrapping DR analysis capabilities into the vectorizer, addressing PR tree-optimization/121908. It modifies tree-vect-data-refs.cc to allow non-wrapping DR analysis, and tree-vect-loop.cc to defer assumption checking, introduce vect_get_loop_datarefs and vect_build_assumptions, and use these in vect_analyze_loop. The new niter < bounds_min assumption is added, derived from the minimum non-wrapping bounds found for DRs. DR analysis is moved earlier, after vect_analyze_loop_form, to facilitate this integration.

For Context
Vectorizer
A compiler component that automatically transforms loops to perform the same computations on multiple data elements simultaneously, often using SIMD (Single Instruction, Multiple Data) instructions for performance gains.
Data Reference (DR) analysis
Analyzes how data is accessed within loops to understand potential dependencies or patterns. This helps the compiler determine if and how a loop can be vectorized.
non-wrapping bounds
Refers to loop bounds that do not 'wrap around' due to integer overflow. Understanding these bounds helps in accurately predicting loop behavior and avoiding incorrect assumptions.
iteration assumptions
Assumptions made by the compiler about the number of times a loop will execute, used to guide optimization decisions. These can be based on explicit bounds or inferred properties.
SIMD
Single Instruction, Multiple Data. A class of parallel computers in Flynn's taxonomy that perform the same operation on multiple data points simultaneously.
Filed Under: vectvectorizerdata-referenceoptimization