The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
29.15k
stars
12.03k
forks
source link
[Flang] TSVC s115: compiler doesn't vectorize the loop considering an initial value of do-variable might overflow #110609
Open
yus3710-fj opened 1 month ago
Flang can't vectorize the loop in
s115
of TSVC while Clang can vectorize the loop written in C.Fortran
C
int s115() { init( "s115 "); for (int j = 0; j < LEN2; j++) { for (int i = j+1; i < LEN2; i++) { a[i] -= aa[j][i] * a[j]; } } dummy(a, b, c, d, e, aa, bb, cc, 0.); return 0; }
If
j+1
overflow, the access toa(i)
anda(j)
may overlap so vectorization is prevented. IIRC, compilers don't have to consider it.