Simplify BB reduction group splitting for vectorization
Vectorizer now picks the largest isomorphic subset for BB reduction, improving efficiency.
The GCC vectorizer simplifies the process of splitting basic blocks (BBs) for loop vectorization. It now identifies and selects the largest isomorphic subset of instructions within a BB reduction, allowing for more direct vectorization. This change enhances the efficiency of code generation by improving how instruction groups are chosen for vector processing.
In Details
This change in tree-vect-slp.cc modifies vect_build_slp_instance to select the largest isomorphic subset for BB reduction vectorization. Previously, it might not have picked the optimal group. This leverages improvements in matches[] to directly vectorize larger, more suitable instruction groups, simplifying the overall BB vectorization strategy.
- BB reduction
- A basic block (BB) reduction refers to a pattern of straight-line code within a function. Vectorization aims to replace these sequences with a single instruction that operates on multiple data elements simultaneously.
- isomorphic
- In this context, isomorphic means that a group of instructions has the same structure and can be mapped to a vector operation. The vectorizer looks for such patterns to replace scalar operations with vector ones.
- vectorization
- The process of converting scalar operations (operating on single data elements) into vector operations (operating on multiple data elements simultaneously) to improve performance on suitable hardware.