tree-optimization/128132 - induction SLP with different induction kinds
Fixes SLP vectorization to reject groups with differing induction kinds.
This commit addresses an issue in Superword-Level Parallelism (SLP) vectorization where groups of instructions with different induction types were incorrectly processed. The vectorizable_induction function now rejects SLP groups that exhibit varying induction subtypes, preventing potential misvectorization. This change ensures that SLP vectorization correctly handles induction variables within loops and improves the robustness of the vectorization pass.
In Details
This patch provides a minimal fix for PR128132 by addressing how vect_get_and_check_slp_defs handles differing induction kinds. The vectorizable_induction function now explicitly rejects SLP groups where the induction subtypes are effectively different. This prevents the SLP vectorizer from incorrectly grouping instructions that rely on distinct induction patterns, ensuring more accurate vectorization of loops.
- SLP
- Superword-Level Parallelism. A compiler optimization technique that finds consecutive, independent instructions operating on different data elements and combines them into a single vector instruction.
- vectorization
- The process of transforming scalar code (operating on single data items) into vector code (operating on multiple data items simultaneously using SIMD instructions).
- induction variable
- A variable in a loop whose value changes by a constant amount in each iteration, commonly used for loop control and array indexing.
- tree-optimization
- A phase in the GCC compiler pipeline where optimizations are performed on the GIMPLE intermediate representation.