Skip to content

Commit a7337c4

Browse files
author
Ewan Crawford
committed
Merge remote-tracking branch 'github/sycl' into fabio/binary_update_fix
2 parents cdafff4 + 5d5a570 commit a7337c4

File tree

51 files changed

+624
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+624
-271
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5590,7 +5590,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
55905590
// only be used for SPIR/SPIR-V based targets.
55915591
if (Triple.isSPIROrSPIRV())
55925592
if (Args.hasFlag(options::OPT_fsycl_instrument_device_code,
5593-
options::OPT_fno_sycl_instrument_device_code, true))
5593+
options::OPT_fno_sycl_instrument_device_code, false))
55945594
CmdArgs.push_back("-fsycl-instrument-device-code");
55955595

55965596
if (!SYCLStdArg) {

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
508508
}
509509

510510
if (Args.hasFlag(options::OPT_fsycl_instrument_device_code,
511-
options::OPT_fno_sycl_instrument_device_code, true))
511+
options::OPT_fno_sycl_instrument_device_code, false))
512512
addLibraries(SYCLDeviceAnnotationLibs);
513513

514514
#if !defined(_WIN32)

clang/test/Driver/sycl-device-lib-amdgcn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Check if internal libraries are still linked against when linkage of all
88
// device libs is manually excluded.
99
// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl -fno-sycl-device-lib=all --sysroot=%S/Inputs/SYCL \
10-
// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 %s 2>&1 \
10+
// RUN: -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 -fsycl-instrument-device-code %s 2>&1 \
1111
// RUN: | FileCheck -check-prefix=CHK-NO-DEVLIB %s
1212

1313
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib-amdgcn-amd-amdhsa.bc", ir, (device-sycl, gfx906)

clang/test/Driver/sycl-device-lib-nvptx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Check if internal libraries are still linked against when linkage of all
88
// device libs is manually excluded.
99
// RUN: %clangxx -ccc-print-phases -std=c++11 -fsycl -fno-sycl-device-lib=all --sysroot=%S/Inputs/SYCL \
10-
// RUN: -fsycl-targets=nvptx64-nvidia-cuda %s 2>&1 \
10+
// RUN: -fsycl-targets=nvptx64-nvidia-cuda -fsycl-instrument-device-code %s 2>&1 \
1111
// RUN: | FileCheck -check-prefix=CHK-NO-DEVLIB %s
1212

1313
// CHK-NO-DEVLIB-NOT: {{[0-9]+}}: input, "{{.*}}devicelib-nvptx64-nvidia-cuda.bc", ir, (device-sycl, sm_50)

clang/test/Driver/sycl-early-device-link-old-model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64_gen \
2424
// RUN: --target=x86_64-unknown-linux-gnu -Xsycl-target-backend \
2525
// RUN: "-device skl" --sysroot=%S/Inputs/SYCL -ccc-print-phases %s \
26-
// RUN: -fno-sycl-device-lib=all 2>&1 \
26+
// RUN: -fsycl-instrument-device-code -fno-sycl-device-lib=all 2>&1 \
2727
// RUN: | FileCheck %s -check-prefix=CREATE_IMAGE_PHASES
2828
// CREATE_IMAGE_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (device-sycl)
2929
// CREATE_IMAGE_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl)
@@ -70,7 +70,7 @@
7070
// RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64,spir64_gen \
7171
// RUN: --target=x86_64-unknown-linux-gnu --sysroot=%S/Inputs/SYCL \
7272
// RUN: -Xsycl-target-backend=spir64_gen "-device skl" \
73-
// RUN: -ccc-print-phases %s -fno-sycl-device-lib=all 2>&1 \
73+
// RUN: -fsycl-instrument-device-code -ccc-print-phases %s -fno-sycl-device-lib=all 2>&1 \
7474
// RUN: | FileCheck %s -check-prefix=JIT_AOT_PHASES
7575
// JIT_AOT_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (device-sycl)
7676
// JIT_AOT_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl)

clang/test/Driver/sycl-instrumentation-old-model.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
// FIXME: Force linux targets to allow for the libraries to be found. Dummy
88
// inputs for --sysroot should be updated to work better for Windows.
99

10-
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver --sysroot=%S/Inputs/SYCL -fsycl-targets=spir64 -### %s 2>&1 \
10+
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-instrument-device-code --sysroot=%S/Inputs/SYCL -fsycl-targets=spir64 -### %s 2>&1 \
1111
// RUN: | FileCheck -check-prefixes=CHECK-SPIRV,CHECK-HOST %s
1212
// -fno-sycl-device-lib mustn't affect the linkage of ITT libraries
13-
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver --sysroot=%S/Inputs/SYCL -fno-sycl-device-lib=all -fsycl-targets=spir64 -### %s 2>&1 \
13+
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fsycl-instrument-device-code --sysroot=%S/Inputs/SYCL -fno-sycl-device-lib=all -fsycl-targets=spir64 -### %s 2>&1 \
1414
// RUN: | FileCheck -check-prefixes=CHECK-SPIRV %s
1515

1616
// CHECK-SPIRV: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-instrument-device-code"
@@ -20,6 +20,12 @@
2020
// CHECK-SPIRV-SAME: "{{.*}}libsycl-itt-stubs.bc"
2121
// CHECK-HOST-NOT: "-cc1"{{.*}} "-fsycl-is-host"{{.*}} "-fsycl-instrument-device-code"
2222

23+
// ITT annotations in device code are disabled by default.
24+
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=spir64 -### %s 2>&1 \
25+
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
26+
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -### %s 2>&1 \
27+
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
28+
2329
// RUN: %clangxx -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fsycl-targets=spir64 -### %s 2>&1 \
2430
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
2531
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code -nocudalib -### %s 2>&1 \

clang/test/Driver/sycl-instrumentation.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
// FIXME: Force linux targets to allow for the libraries to be found. Dummy
88
// inputs for --sysroot should be updated to work better for Windows.
99

10-
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver --sysroot=%S/Inputs/SYCL -fsycl-targets=spir64 -### %s 2>&1 \
10+
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fsycl-instrument-device-code --offload-new-driver --sysroot=%S/Inputs/SYCL -fsycl-targets=spir64 -### %s 2>&1 \
1111
// RUN: | FileCheck -check-prefixes=CHECK-SPIRV,CHECK-HOST %s
1212
// -fno-sycl-device-lib mustn't affect the linkage of ITT libraries
13-
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --offload-new-driver --sysroot=%S/Inputs/SYCL -fno-sycl-device-lib=all -fsycl-targets=spir64 -### %s 2>&1 \
13+
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fsycl-instrument-device-code --offload-new-driver --sysroot=%S/Inputs/SYCL -fno-sycl-device-lib=all -fsycl-targets=spir64 -### %s 2>&1 \
1414
// RUN: | FileCheck -check-prefixes=CHECK-SPIRV %s
1515

1616
// CHECK-SPIRV: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-instrument-device-code"
@@ -19,6 +19,12 @@
1919
// CHECK-SPIRV-SAME: libsycl-itt-compiler-wrappers.new.o
2020
// CHECK-SPIRV-SAME: libsycl-itt-stubs.new.o
2121

22+
// ITT annotations in device code are disabled by default.
23+
// RUN: %clangxx -fsycl --offload-new-driver -fsycl-targets=spir64 -### %s 2>&1 \
24+
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
25+
// RUN: %clangxx -fsycl --offload-new-driver -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -### %s 2>&1 \
26+
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
27+
2228
// RUN: %clangxx -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fsycl-targets=spir64 -### %s 2>&1 \
2329
// RUN: | FileCheck -check-prefixes=CHECK-NONPASSED %s
2430
// RUN: %clangxx -fsycl --offload-new-driver -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-instrument-device-code -nocudalib -### %s 2>&1 \

clang/test/Driver/sycl-no-rdc-fat-archive-old-model.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
// RUN: echo "void foo(void) {}" > %t1.cpp
66
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver %t1.cpp -c -o %t1_bundle.o
77
// RUN: llvm-ar cr %t_lib.a %t1_bundle.o
8-
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-device-code-split=off --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
9-
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-device-code-split=auto --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
10-
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-device-code-split=per_kernel --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
11-
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-device-code-split=per_source --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
8+
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=off --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
9+
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=auto --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
10+
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=per_kernel --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
11+
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=per_source --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
1212
// CHECK: 1: input, "{{.*}}_lib.a", archive
1313
// CHECK: 2: clang-offload-unbundler, {1}, tempfilelist
1414
// CHECK: 3: spirv-to-ir-wrapper, {2}, tempfilelist, (device-sycl)

clang/test/Driver/sycl-no-rdc-fat-archive-win.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
// RUN: echo "void foo(void) {}" > %t1.cpp
66
// RUN: %clangxx -target x86_64-pc-windows-msvc -fsycl %t1.cpp -c -o %t1_bundle.o
77
// RUN: llvm-ar cr %t_lib.a %t1_bundle.o
8-
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=off --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
9-
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=auto --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
10-
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=per_kernel --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
11-
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=per_source --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
12-
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=off /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
13-
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=auto /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
14-
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=per_kernel /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
15-
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-device-code-split=per_source /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
8+
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=off --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
9+
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=auto --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
10+
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=per_kernel --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
11+
// RUN: %clang -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=per_source --sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
12+
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=off /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
13+
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=auto /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
14+
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=per_kernel /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
15+
// RUN: %clang_cl -### -fsycl -fno-sycl-rdc -fsycl-instrument-device-code -fsycl-device-code-split=per_source /clang:--sysroot=%S/Inputs/SYCL %t_lib.a 2>&1 -ccc-print-phases | FileCheck %s
1616
// CHECK: 0: input, "[[INPUT:.+\.a]]", object, (host-sycl)
1717
// CHECK: 1: input, "[[INPUT]]", archive
1818
// CHECK: 2: clang-offload-unbundler, {1}, tempfilelist

clang/test/Driver/sycl-no-rdc-old-model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// RUN: touch %t1.cpp
55
// RUN: touch %t2.cpp
6-
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc --sysroot=%S/Inputs/SYCL %t1.cpp %t2.cpp 2>&1 -ccc-print-phases | FileCheck %s
6+
// RUN: %clang -### -fsycl --no-offload-new-driver -fno-sycl-rdc -fsycl-instrument-device-code --sysroot=%S/Inputs/SYCL %t1.cpp %t2.cpp 2>&1 -ccc-print-phases | FileCheck %s
77

88
// CHECK: 2: input, "{{.*}}1.cpp", c++, (device-sycl)
99
// CHECK: 3: preprocessor, {2}, c++-cpp-output, (device-sycl)

0 commit comments

Comments
 (0)