Regarding this result, it appears to me that it is vectorized for i in the outer loop.
-mllvm -debug-only=loop-vectorize messages:
LV: Checking a loop in 's235' from s235.c:19:4
LV: Loop hints: force=? width=vscale x 0 interleave=0
LV: Found a loop: for.body13
LV: Not vectorizing: Found an unidentified PHI %3 = phi float [ %.pre, %for.body4 ], [ %add25, %for.body13 ], !dbg !30
LV: Interleaving disabled by the pass manager
LV: Can't vectorize the instructions or CFG
LLVM does not appear to be able to account for vectorization of loops of the form s235.c.
Clang cannot SVE vectorize TSVC s235, but GCC13.2.0 can.
Option:
-Ofast -march=armv8.2-a+sve
See also (Clang vs GCC): https://godbolt.org/z/KeeK58oz7
GCC result:
Regarding this result, it appears to me that it is vectorized for i in the outer loop.
-mllvm -debug-only=loop-vectorize
messages:LLVM does not appear to be able to account for vectorization of loops of the form s235.c.