Open
Description
On clang 19.1.7
void prefix_scan_omp_simd(uint64_t n, const float *const __restrict src,
float *const __restrict dst, const double init) {
auto acc = init;
#pragma omp simd reduction(inscan, + : acc)
for (uint64_t i = 0; i < n; ++i) {
acc += src[i];
#pragma omp scan inclusive(acc)
dst[i] = acc;
}
}
The following code is emitting the warning
warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
15 | #pragma omp simd reduction(inscan, + : acc)
| ^
1 warning generated.
While on gcc it suceeds.
Activity
llvmbot commentedon Apr 29, 2025
@llvm/issue-subscribers-openmp
Author: Isaac David (orpheezt)
The following code is emitting the warning
While on gcc it suceeds.
fhahn commentedon Apr 29, 2025
What's the behavior of
#pragma omp scan inclusive(acc)
, how is it encoded in LLVM? cc @Meinersbur @alexey-bataevMeinersbur commentedon Apr 29, 2025
bd1c03d
I don't know what happens with a
simd inscan
though. One of the lowered implementation loops might just not be vectorizable.