|
| 1 | +/// Check that optimizations for sycl device are enabled by default: |
| 2 | +// RUN: %clang -### -fsycl --offload-new-driver %s 2>&1 \ |
| 3 | +// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s |
| 4 | +// RUN: %clang_cl -### -fsycl --offload-new-driver %s 2>&1 \ |
| 5 | +// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s |
| 6 | +// RUN: %clang -### -fsycl --offload-new-driver -fsycl-device-only %s 2>&1 \ |
| 7 | +// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s |
| 8 | +// RUN: %clang_cl -### -fsycl --offload-new-driver -fsycl-device-only %s 2>&1 \ |
| 9 | +// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s |
| 10 | +// RUN: %clang -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \ |
| 11 | +// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s |
| 12 | +// RUN: %clang_cl -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \ |
| 13 | +// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s |
| 14 | +// CHECK-DEFAULT-NOT: "-fno-sycl-early-optimizations" |
| 15 | +// CHECK-DEFAULT-NOT: "-disable-llvm-passes" |
| 16 | +// CHECK-DEFAULT: "-fsycl-is-device" |
| 17 | +// CHECK-DEFAULT-SAME: "-O2" |
1 | 18 |
|
| 19 | +/// Check "-fno-sycl-early-optimizations" is passed to the front-end: |
| 20 | +// RUN: %clang -### -fsycl --offload-new-driver -fno-sycl-early-optimizations %s 2>&1 \ |
| 21 | +// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s |
| 22 | +// RUN: %clang_cl -### -fsycl --offload-new-driver -fno-sycl-early-optimizations %s 2>&1 \ |
| 23 | +// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s |
| 24 | +// RUN: %clang -### -fsycl --offload-new-driver -fsycl-device-only -fno-sycl-early-optimizations %s 2>&1 \ |
| 25 | +// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s |
| 26 | +// RUN: %clang_cl -### -fsycl --offload-new-driver -fsycl-device-only -fno-sycl-early-optimizations %s 2>&1 \ |
| 27 | +// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s |
| 28 | +// RUN: %clang -### -fintelfpga %s 2>&1 \ |
| 29 | +// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s |
| 30 | +// RUN: %clang_cl -### -fintelfpga %s 2>&1 \ |
| 31 | +// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s |
| 32 | +// CHECK-NO-SYCL-EARLY-OPTS: "-fno-sycl-early-optimizations" |
2 | 33 |
|
| 34 | +/// Check that Dead Parameter Elimination Optimization is enabled |
| 35 | +// RUN: %clang -### -fsycl --offload-new-driver %s 2>&1 \ |
| 36 | +// RUN: | FileCheck -check-prefix=CHECK-DAE %s |
| 37 | +// RUN: %clang_cl -### -fsycl --offload-new-driver %s 2>&1 \ |
| 38 | +// RUN: | FileCheck -check-prefix=CHECK-DAE %s |
| 39 | +// CHECK-DAE: clang{{.*}} "-fenable-sycl-dae" |
3 | 40 |
|
| 41 | +/// Check that Dead Parameter Elimination Optimization is disabled |
| 42 | +// RUN: %clang -### -fsycl --offload-new-driver -fno-sycl-dead-args-optimization %s 2>&1 \ |
| 43 | +// RUN: | FileCheck -check-prefix=CHECK-NO-DAE %s |
| 44 | +// RUN: %clang_cl -### -fsycl --offload-new-driver -fno-sycl-dead-args-optimization %s 2>&1 \ |
| 45 | +// RUN: | FileCheck -check-prefix=CHECK-NO-DAE %s |
| 46 | +// CHECK-NO-DAE-NOT: clang{{.*}} "-fenable-sycl-dae" |
4 | 47 |
|
5 | | -/// Check that optimizations for sycl device are enabled with -g and O2 passed: |
| 48 | +// Check "-fgpu-inline-threshold" is passed to the front-end: |
| 49 | +// RUN: %clang -### -fsycl --offload-new-driver -fgpu-inline-threshold=100000 %s 2>&1 \ |
| 50 | +// RUN: | FileCheck -check-prefix=CHECK-THRESH %s |
| 51 | +// CHECK-THRESH: "-mllvm" "-inline-threshold=100000" |
6 | 52 |
|
7 | | -// RUN: %clang_cl -### -fsycl -O2 -g %s 2>&1 \ |
| 53 | +// RUN: %clang -### -fsycl --offload-new-driver %s 2>&1 \ |
| 54 | +// RUN: | FileCheck -check-prefix=CHECK-NO-THRESH %s |
| 55 | +// CHECK-NO-THRESH-NOT: "-mllvm" "-inline-threshold |
| 56 | + |
| 57 | +/// Check that optimizations for sycl device are disabled with -g passed: |
| 58 | +// RUN: %clang -### -fsycl -g %s 2>&1 \ |
| 59 | +// RUN: | FileCheck -check-prefix=CHECK-DEBUG %s |
| 60 | +// RUN: %clang_cl -### -fsycl -g %s 2>&1 \ |
| 61 | +// RUN: | FileCheck -check-prefix=CHECK-DEBUG %s |
| 62 | +// CHECK-DEBUG: clang{{.*}} "-fsycl-is-device{{.*}}" "-O0" |
| 63 | +// CHECK-DEBUG: sycl-post-link{{.*}} "-O0" |
| 64 | +// CHECK-DEBUG-NOT: "-O2" |
| 65 | + |
| 66 | +/// Check that optimizations for sycl device are enabled with -g and O2 passed: |
| 67 | +// RUN: %clang -### -fsycl -O2 -g %s 2>&1 \ |
8 | 68 | // RUN: | FileCheck -check-prefix=CHECK-G-O2 %s |
9 | | -// CHECK-G-O2: clang{{.*}} "-fsycl-is-device{{.*}}" "-O3" |
10 | | -// CHECK-G-O2: sycl-post-link{{.*}} "-O3" |
| 69 | +// For clang_cl, -O2 maps to -O3 |
| 70 | +// RUN: %clang_cl -### -fsycl -O2 -g %s 2>&1 \ |
| 71 | +// RUN: | FileCheck -check-prefix=CHECK-G-O3 %s |
| 72 | +// CHECK-G-O2: clang{{.*}} "-fsycl-is-device{{.*}}" "-O2" |
| 73 | +// CHECK-G-O2: sycl-post-link{{.*}} "-O2" |
11 | 74 | // CHECK-G-O2-NOT: "-O0" |
| 75 | +// CHECK-G-O3: clang{{.*}} "-fsycl-is-device{{.*}}" "-O3" |
| 76 | +// CHECK-G-O3: sycl-post-link{{.*}} "-O3" |
| 77 | +// CHECK-G-O3-NOT: "-O0" |
| 78 | + |
| 79 | +/// Check that -O2 is passed for FPGA |
| 80 | +// RUN: %clang -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \ |
| 81 | +// RUN: | FileCheck -check-prefix=CHECK-FPGA %s |
| 82 | +// RUN: %clang_cl -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \ |
| 83 | +// RUN: | FileCheck -check-prefix=CHECK-FPGA %s |
| 84 | +// CHECK-FPGA: clang{{.*}} "-fsycl-is-device{{.*}}" "-O2" |
| 85 | +// CHECK-FPGA: sycl-post-link{{.*}} "-O2" |
| 86 | +// CHECK-FPGA-NOT: "-O0" |
12 | 87 |
|
| 88 | +/// Check that -O2 preserves for FPGA when it's explicitly passed |
| 89 | +// RUN: %clang -### -O2 -fintelfpga -fsycl-early-optimizations %s 2>&1 \ |
| 90 | +// RUN: | FileCheck -check-prefix=CHECK-FPGA-O2 %s |
| 91 | +// For clang_cl, -O2 maps to -O3 |
| 92 | +// RUN: %clang_cl -### -O2 -fintelfpga -fsycl-early-optimizations %s 2>&1 \ |
| 93 | +// RUN: | FileCheck -check-prefix=CHECK-FPGA-O3 %s |
| 94 | +// CHECK-FPGA-O2: clang{{.*}} "-fsycl-is-device{{.*}}" "-O2" |
| 95 | +// CHECK-FPGA-O2: sycl-post-link{{.*}} "-O2" |
| 96 | +// CHECK-FPGA-O2-NOT: "-O0" |
| 97 | +// CHECK-FPGA-O3: clang{{.*}} "-fsycl-is-device{{.*}}" "-O3" |
| 98 | +// CHECK-FPGA-O3: sycl-post-link{{.*}} "-O3" |
| 99 | +// CHECK-FPGA-O3-NOT: "-O0" |
13 | 100 |
|
| 101 | +/// Check that -O0 is passed for FPGA when -g is explicitly passed |
| 102 | +// RUN: %clang -### -fintelfpga -g %s 2>&1 \ |
| 103 | +// RUN: | FileCheck -check-prefix=CHECK-FPGA-O0 %s |
| 104 | +// RUN: %clang_cl -### -fintelfpga -g %s 2>&1 \ |
| 105 | +// RUN: | FileCheck -check-prefix=CHECK-FPGA-O0 %s |
| 106 | +// CHECK-FPGA-O0: clang{{.*}} "-fsycl-is-device{{.*}}" "-O0" |
| 107 | +// CHECK-FPGA-O0: sycl-post-link{{.*}} "-O0" |
| 108 | +// CHECK-FPGA-O0-NOT: "-O2" |
14 | 109 |
|
15 | 110 |
|
16 | 111 |
|
0 commit comments