llvm-project/clang/test/Frontend/optimization-remark-analysis.c
Florian Hahn 4b3bc46d1d
[Remarks] Update LV analysis remark frontend test to avoid switch.
Support for vectorizing switch statements will be added in
https://github.com/llvm/llvm-project/pull/99808.

Update the loop to use a call that cannot be vectorized to preserve
testing surfacing analysis remarks via the frontend.
2024-08-05 21:24:40 +01:00

15 lines
502 B
C

// RUN: %clang -O1 -fvectorize -target x86_64-unknown-unknown -emit-llvm -Rpass-analysis -S %s -o - 2>&1 | FileCheck %s --check-prefix=RPASS
// RUN: %clang -O1 -fvectorize -target x86_64-unknown-unknown -emit-llvm -S %s -o - 2>&1 | FileCheck %s
// RPASS: {{.*}}:12:5: remark: loop not vectorized: call instruction cannot be vectorized
// CHECK-NOT: remark: loop not vectorized
void bar(void);
void foo(int N) {
#pragma clang loop vectorize(enable)
for (int i = 0; i < N; i++) {
bar();
}
}