Uncounted loop vectorization example doesn't work with unsigned index
The uncounted loop vectorization in GCC 16 doesn't work with unsigned loop indexes in the example.
Ionuț Nicula reports that the uncounted loop vectorization example in GCC 16 fails when using an unsigned type for the loop index, while working correctly with signed integers. This may be a limitation in the current implementation. Users who rely on loop vectorization with unsigned indexes should be aware of this limitation.
In Details
Loop vectorization is a compiler optimization that transforms a loop to execute multiple iterations in parallel using SIMD instructions. The compiler analyzes the loop's data dependencies and control flow to safely execute multiple iterations concurrently, improving performance on suitable hardware. The standard test case is gcc/testsuite/gcc.dg/vect/vect-uncounted_1.c.
For Context
Vectorization is a compiler optimization technique that transforms scalar operations into vector operations, enabling the processor to perform the same operation on multiple data elements simultaneously. This is especially useful in loops, where the same sequence of operations is repeated multiple times. Compilers may struggle when the number of loop iterations isn't known ahead of time.