-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes
Description
Hi,
I try to find if there is already an issue on the subject, but I did not find any.
I work on loop like this (https://godbolt.org/z/fchd4e54e), where the final index on the result array y is given by the integer table face_cell :
void compute_local_extrema(
const int nface,
const int ncell,
const int* __restrict face_cell,
const double* __restrict x,
double* __restrict y) {
int il, ir;
#pragma clang loop distribute(enable) vectorize(enable) interleave(enable)
for (int iface=0; iface<nface; ++iface) {
il = face_cell[iface];
ir = face_cell[iface+nface];
y[il] = std::max(y[il], x[ir]);
}
}It seems that the auto-vectorize does not work on the kind of loop, despite the fact that it seems working on GCC (https://godbolt.org/z/944q8M6T1 from 12.2 to 13.3).
Is there a way to finally vectorize this kind of loop ?
If it is possible, can you give me some advices on how to do this?
Thanks a lot for your help.
Bertrand M.
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes