Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libomptarget / test / offloading / small_trip_count.c
blobd8bef667607a1cd0764dc20fc6e7425219e53e92
1 // clang-format off
2 // RUN: %libomptarget-compile-generic
3 // RUN: env LIBOMPTARGET_INFO=16 \
4 // RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=DEFAULT
5 // RUN: env LIBOMPTARGET_INFO=16 LIBOMPTARGET_MIN_THREADS_FOR_LOW_TRIP_COUNT=8 \
6 // RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=EIGHT
8 // UNSUPPORTED: aarch64-unknown-linux-gnu
9 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
10 // UNSUPPORTED: x86_64-pc-linux-gnu
11 // UNSUPPORTED: x86_64-pc-linux-gnu-LTO
13 #define N 128
15 __attribute__((optnone)) void optnone() {}
17 int main() {
18 // DEFAULT: Launching kernel {{.+_main_.+}} with 4 blocks and 32 threads in SPMD mode
19 // EIGHT: Launching kernel {{.+_main_.+}} with 16 blocks and 8 threads in SPMD mode
20 #pragma omp target teams distribute parallel for simd
21 for (int i = 0; i < N; ++i) {
22 optnone();
24 // DEFAULT: Launching kernel {{.+_main_.+}} with 4 blocks and 32 threads in SPMD mode
25 // EIGHT: Launching kernel {{.+_main_.+}} with 16 blocks and 8 threads in SPMD mode
26 #pragma omp target teams distribute parallel for simd
27 for (int i = 0; i < N - 1; ++i) {
28 optnone();
30 // DEFAULT: Launching kernel {{.+_main_.+}} with 5 blocks and 32 threads in SPMD mode
31 // EIGHT: Launching kernel {{.+_main_.+}} with 17 blocks and 8 threads in SPMD mode
32 #pragma omp target teams distribute parallel for simd
33 for (int i = 0; i < N + 1; ++i) {
34 optnone();
36 // DEFAULT: Launching kernel {{.+_main_.+}} with 32 blocks and 4 threads in SPMD mode
37 // EIGHT: Launching kernel {{.+_main_.+}} with 32 blocks and 4 threads in SPMD mode
38 #pragma omp target teams distribute parallel for simd thread_limit(4)
39 for (int i = 0; i < N; ++i) {
40 optnone();