Vectorizer uses LOOP_VINFO_IV_INCREMENT for loop induction variables
Vectorizer now uses a new value, LOOP_VINFO_IV_INCREMENT, improving loop variant induction variable handling.
The GCC vectorizer introduces LOOP_VINFO_IV_INCREMENT to store the number of scalar iterations a vectorized loop iteration represents. This change allows induction variable (IV) updates and reductions to correctly use this value, including loop-variant IV increments. This simplifies internal logic by removing special cases for SELECT_VL and enables more flexible handling of pointer arithmetic in grouped loads and stores.
In Details
This commit refactors the vectorizer's handling of induction variables (IVs) by introducing LOOP_VINFO_IV_INCREMENT. This new value represents the scalar iteration count per vectorized iteration, replacing the previous reliance on VF (Vector Factor). This allows for loop-variant IV increments and simplifies pointer arithmetic logic (vect_get_data_ptr_increment, vect_get_data_ptr_bump) by removing SELECT_VL special cases. The update impacts tree-ssa-loop-manip.h, tree-vect-data-refs.cc, tree-vect-loop-manip.cc, tree-vect-loop.cc, and tree-vect-stmts.cc.
- Vectorizer
- A compiler component that transforms loops to perform the same operation on multiple data elements simultaneously using SIMD (Single Instruction, Multiple Data) instructions.
- Induction Variable (IV)
- A variable in a loop whose value is modified in a predictable way with each iteration, typically used for array indexing or loop control.
- VF
- Vector Factor. In the context of vectorization, this typically represents the number of elements processed in parallel by a single vectorized instruction.
- SELECT_VL
- Likely refers to a specific mechanism or instruction within GCC's vectorization framework used for conditional selection or handling of vector lengths, which has been simplified or replaced by the new IV increment logic.
- SIMD
- Single Instruction, Multiple Data. A class of parallel computing where a single instruction operates on multiple data points simultaneously.