Skip to content

Commit 70962b1

Browse files
[SYCL][Driver] Update fsycl-dump-device-code option name.
1 parent 72b92c3 commit 70962b1

File tree

8 files changed

+57
-57
lines changed

8 files changed

+57
-57
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7297,7 +7297,7 @@ defm sycl_allow_device_image_dependencies: BoolOptionWithoutMarshalling<"f", "sy
72977297
PosFlag<SetTrue, [], [ClangOption], "Allow dependencies between device code images">,
72987298
NegFlag<SetFalse, [], [ClangOption], "Do not allow dependencies between device code images (default)">>;
72997299

7300-
def fsycl_dump_device_code_EQ : Joined<["-"], "fsycl-dump-device-code=">,
7300+
def fdump_device_code_EQ : Joined<["-"], "fdump-device-code=">,
73017301
Flags<[NoXarchOption]>,
73027302
HelpText<"Dump device code into the user provided directory.">;
73037303
def fsyclbin : Flag<["-"], "fsyclbin">,

clang/lib/Driver/Compilation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ bool Compilation::CleanupFile(const char *File, bool IssueErrors) const {
182182
// able to remove), or non-regular files. Underlying tools may have
183183
// intentionally not overwritten them.
184184

185-
// Save the device code files if -fsycl-dump-device-code option is enabled.
185+
// Save the device code files if -fdump-device-code option is enabled.
186186
if (TheDriver.isDumpDeviceCodeEnabled()) {
187187
Arg *DumpDeviceCodeArg =
188-
getArgs().getLastArg(options::OPT_fsycl_dump_device_code_EQ);
188+
getArgs().getLastArg(options::OPT_fdump_device_code_EQ);
189189
std::string ExpectedDir =
190190
DumpDeviceCodeArg ? DumpDeviceCodeArg->getValue() : "";
191191
std::string ActualFile(File);

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
20982098
.Default(SaveTempsCwd);
20992099
}
21002100

2101-
if (Args.getLastArg(options::OPT_fsycl_dump_device_code_EQ))
2101+
if (Args.getLastArg(options::OPT_fdump_device_code_EQ))
21022102
DumpDeviceCode = true;
21032103

21042104
if (const Arg *A = Args.getLastArg(

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10737,13 +10737,13 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
1073710737
TCArgs.MakeArgString("--out-file-list=" + OutputFileName));
1073810738
ForeachArgs.push_back(
1073910739
TCArgs.MakeArgString("--out-replace=" + OutputFileName));
10740-
// If fsycl-dump-device-code is passed, put the output files from llvm-spirv
10741-
// into the path provided in fsycl-dump-device-code.
10740+
// If fdump-device-code is passed, put the output files from llvm-spirv
10741+
// into the path provided in fdump-device-code.
1074210742
if (C.getDriver().isDumpDeviceCodeEnabled()) {
1074310743
SmallString<128> OutputDir;
1074410744

1074510745
Arg *DumpDeviceCodeArg =
10746-
C.getArgs().getLastArg(options::OPT_fsycl_dump_device_code_EQ);
10746+
C.getArgs().getLastArg(options::OPT_fdump_device_code_EQ);
1074710747

1074810748
OutputDir = (DumpDeviceCodeArg ? DumpDeviceCodeArg->getValue() : "");
1074910749

@@ -11401,10 +11401,10 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1140111401

1140211402
if (C.getDriver().isDumpDeviceCodeEnabled()) {
1140311403
SmallString<128> DumpDir;
11404-
Arg *A = C.getArgs().getLastArg(options::OPT_fsycl_dump_device_code_EQ);
11404+
Arg *A = C.getArgs().getLastArg(options::OPT_fdump_device_code_EQ);
1140511405
DumpDir = A ? A->getValue() : "";
1140611406
CmdArgs.push_back(
11407-
Args.MakeArgString(Twine("-sycl-dump-device-code=") + DumpDir));
11407+
Args.MakeArgString(Twine("-dump-device-code=") + DumpDir));
1140811408
}
1140911409

1141011410
auto appendOption = [](SmallString<128> &OptString, StringRef AddOpt) {

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ void SYCL::constructLLVMForeachCommand(Compilation &C, const JobAction &JA,
248248
C.getArgs().MakeArgString("--out-dir=" + OutputDirName));
249249
}
250250

251-
// If fsycl-dump-device-code is passed, put the PTX files
252-
// into the path provided in fsycl-dump-device-code.
251+
// If fdump-device-code is passed, put the PTX files
252+
// into the path provided in fdump-device-code.
253253
if (T->getToolChain().getTriple().isNVPTX() &&
254254
C.getDriver().isDumpDeviceCodeEnabled() && Ext == "s") {
255255
SmallString<128> OutputDir;
256256

257257
Arg *DumpDeviceCodeArg =
258-
C.getArgs().getLastArg(options::OPT_fsycl_dump_device_code_EQ);
258+
C.getArgs().getLastArg(options::OPT_fdump_device_code_EQ);
259259

260260
OutputDir = (DumpDeviceCodeArg ? DumpDeviceCodeArg->getValue() : "");
261261

clang/test/Driver/save-ptx-files.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// Save PTX files during PTX target processing using -fsycl-dump-device-code option.
1+
// Save PTX files during PTX target processing using -fdump-device-code option.
22

3-
// Verify that -fsycl-dump-device-code saves PTX files in the user provided directory
3+
// Verify that -fdump-device-code saves PTX files in the user provided directory
44
// while targeting CUDA enabled GPUs.
55

66
// Linux
7-
// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64-unknown-unknown -target x86_64-unknown-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fsycl-dump-device-code=/user/input/path %s 2>&1 \
7+
// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64-unknown-unknown -target x86_64-unknown-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fdump-device-code=/user/input/path %s 2>&1 \
88
// RUN: | FileCheck %s --check-prefixes=CHECK-PTX-FILES,CHECK-SPIRV-FILES
99

1010
// clang --driver-mode=g++
11-
// RUN: %clangxx -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda -target x86_64-unknown-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fsycl-dump-device-code=/user/input/path %s 2>&1 \
11+
// RUN: %clangxx -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda -target x86_64-unknown-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fdump-device-code=/user/input/path %s 2>&1 \
1212
// RUN: | FileCheck %s --check-prefixes=CHECK-PTX-FILES
1313

14-
// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64-unknown-unknown -target x86_64-unknown-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fsycl-dump-device-code= %s 2>&1 \
14+
// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64-unknown-unknown -target x86_64-unknown-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda -fdump-device-code= %s 2>&1 \
1515
// RUN: | FileCheck %s --check-prefixes=CHECK-PTX-FILES-CWD,CHECK-SPIRV-FILES-CWD
1616

1717
// CHECK-PTX-FILES: llvm-foreach{{.*}} "--out-ext=s"{{.*}} "--out-dir=/user/input/path{{(/|\\\\)}}" "--" "{{.*}}clang{{.*}}" {{.*}} "-fsycl-is-device" {{.*}}.s{{.*}}
@@ -22,20 +22,20 @@
2222
// Windows - Check if PTX files are saved in the user provided path.
2323
// RUN: %clang_cl -### -fsycl \
2424
// RUN: -fsycl-targets=nvptx64-nvidia-cuda --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
25-
// RUN: -fsycl-dump-device-code=/user/input/path %s 2>&1 \
25+
// RUN: -fdump-device-code=/user/input/path %s 2>&1 \
2626
// RUN: | FileCheck -check-prefix=CHECK-PTX-WIN %s
2727

2828
// Windows - Check if PTX and SPV files are saved in user provided path.
2929
// RUN: %clang_cl -### -fsycl \
3030
// RUN: -fsycl-targets=nvptx64-nvidia-cuda,spir64-unknown-unknown --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
31-
// RUN: -fsycl-dump-device-code=/user/input/path %s 2>&1 \
31+
// RUN: -fdump-device-code=/user/input/path %s 2>&1 \
3232
// RUN: | FileCheck -check-prefixes=CHECK-PTX-WIN,CHECK-SPV-WIN %s
3333

34-
// Windows - Check PTX files saved in current working directory when -fsycl-dump-device-code
34+
// Windows - Check PTX files saved in current working directory when -fdump-device-code
3535
// is empty.
3636
// RUN: %clang_cl -### -fsycl \
3737
// RUN: -fsycl-targets=nvptx64-nvidia-cuda --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
38-
// RUN: -fsycl-dump-device-code= %s 2>&1 \
38+
// RUN: -fdump-device-code= %s 2>&1 \
3939
// RUN: | FileCheck -check-prefix=CHECK-PTX-WIN-CWD %s
4040

4141
// CHECK-PTX-WIN: llvm-foreach{{.*}} "--out-ext=s"{{.*}} "--out-dir=/user/input/path{{(/|\\\\)}}" "--" "{{.*}}clang{{.*}}" {{.*}} "-fsycl-is-device" {{.*}}.asm{{.*}}
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
// SYCL offloading tests using -fsycl-dump-device-code
1+
// SYCL offloading tests using -fdump-device-code
22

3-
// Verify that -fsycl-dump-device-code puts the device code (.spv files)
3+
// Verify that -fdump-device-code puts the device code (.spv files)
44
// in the user provided directory.
55

66
// Linux
77
// clang -fsycl --no-offload-new-driver -target x86_64-unknown-linux-gnu
8-
// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
9-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE
8+
// RUN: %clang -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -fdump-device-code=/user/input/path %s -### 2>&1 \
9+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE
1010

1111
// clang -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown
12-
// RUN: %clang -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
13-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE
12+
// RUN: %clang -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fdump-device-code=/user/input/path %s -### 2>&1 \
13+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE
1414

1515
// clang --driver-mode=g++
16-
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
17-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE
16+
// RUN: %clangxx -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fdump-device-code=/user/input/path %s -### 2>&1 \
17+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE
1818

1919
// Windows
20-
// RUN: %clang_cl -fsycl --no-offload-new-driver -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
21-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-WIN
20+
// RUN: %clang_cl -fsycl --no-offload-new-driver -fdump-device-code=/user/input/path %s -### 2>&1 \
21+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-WIN
2222

23-
// CHK-FSYCL-DUMP-DEVICE-CODE: llvm-foreach{{.*}} "--out-dir=/user/input/path{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
24-
// CHK-FSYCL-DUMP-DEVICE-CODE-WIN: llvm-foreach{{.*}} "--out-dir=/user/input/path{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
23+
// CHK-FDUMP-DEVICE-CODE: llvm-foreach{{.*}} "--out-dir=/user/input/path{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
24+
// CHK-FDUMP-DEVICE-CODE-WIN: llvm-foreach{{.*}} "--out-dir=/user/input/path{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
2525

2626
// Linux
27-
// RUN: %clang -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fsycl-dump-device-code= %s -### 2>&1 \
28-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-CWD
27+
// RUN: %clang -fsycl --no-offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fdump-device-code= %s -### 2>&1 \
28+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-CWD
2929

3030
// Windows
31-
// RUN: %clang_cl -fsycl --no-offload-new-driver -fsycl-dump-device-code= %s -### 2>&1 \
32-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-WIN-CWD
31+
// RUN: %clang_cl -fsycl --no-offload-new-driver -fdump-device-code= %s -### 2>&1 \
32+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-WIN-CWD
3333

34-
// CHK-FSYCL-DUMP-DEVICE-CODE-CWD: llvm-foreach{{.*}} "--out-dir=.{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
35-
// CHK-FSYCL-DUMP-DEVICE-CODE-WIN-CWD: llvm-foreach{{.*}} "--out-dir=.{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
34+
// CHK-FDUMP-DEVICE-CODE-CWD: llvm-foreach{{.*}} "--out-dir=.{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
35+
// CHK-FDUMP-DEVICE-CODE-WIN-CWD: llvm-foreach{{.*}} "--out-dir=.{{(/|\\\\)}}" "--" "{{.*}}llvm-spirv"
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
// SYCL offloading tests using -fsycl-dump-device-code
1+
// SYCL offloading tests using -fdump-device-code
22

3-
// Verify that -fsycl-dump-device-code passes the option to
3+
// Verify that -fdump-device-code passes the option to
44
// clang-linker-wrapper in the new offload model.
55

66
// clang -fsycl --offload-new-driver -target x86_64-unknown-linux-gnu
7-
// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
8-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-NEW-OFFLOAD
7+
// RUN: %clang -fsycl --offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -fdump-device-code=/user/input/path %s -### 2>&1 \
8+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-NEW-OFFLOAD
99

1010
// clang -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown
11-
// RUN: %clang -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
12-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-NEW-OFFLOAD
11+
// RUN: %clang -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fdump-device-code=/user/input/path %s -### 2>&1 \
12+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-NEW-OFFLOAD
1313

1414
// clang --driver-mode=g++
15-
// RUN: %clangxx -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
16-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-NEW-OFFLOAD
15+
// RUN: %clangxx -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fdump-device-code=/user/input/path %s -### 2>&1 \
16+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-NEW-OFFLOAD
1717

1818
// Windows
19-
// RUN: %clang_cl -fsycl --offload-new-driver -fsycl-dump-device-code=/user/input/path %s -### 2>&1 \
20-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-WIN-NEW-OFFLOAD
19+
// RUN: %clang_cl -fsycl --offload-new-driver -fdump-device-code=/user/input/path %s -### 2>&1 \
20+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-WIN-NEW-OFFLOAD
2121

22-
// CHK-FSYCL-DUMP-DEVICE-CODE-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code=/user/input/path"
23-
// CHK-FSYCL-DUMP-DEVICE-CODE-WIN-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code=/user/input/path"
22+
// CHK-FDUMP-DEVICE-CODE-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code=/user/input/path"
23+
// CHK-FDUMP-DEVICE-CODE-WIN-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code=/user/input/path"
2424

2525
// Linux
26-
// RUN: %clang -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fsycl-dump-device-code= %s -### 2>&1 \
27-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-CWD-NEW-OFFLOAD
26+
// RUN: %clang -fsycl --offload-new-driver -fsycl-targets=spir64-unknown-unknown -target x86_64-unknown-linux-gnu -fdump-device-code= %s -### 2>&1 \
27+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-CWD-NEW-OFFLOAD
2828

2929
// Windows
30-
// RUN: %clang_cl -fsycl --offload-new-driver -fsycl-dump-device-code= %s -### 2>&1 \
31-
// RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-DUMP-DEVICE-CODE-WIN-CWD-NEW-OFFLOAD
30+
// RUN: %clang_cl -fsycl --offload-new-driver -fdump-device-code= %s -### 2>&1 \
31+
// RUN: | FileCheck %s --check-prefixes=CHK-FDUMP-DEVICE-CODE-WIN-CWD-NEW-OFFLOAD
3232

33-
// CHK-FSYCL-DUMP-DEVICE-CODE-CWD-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code="
34-
// CHK-FSYCL-DUMP-DEVICE-CODE-WIN-CWD-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code="
33+
// CHK-FDUMP-DEVICE-CODE-CWD-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code="
34+
// CHK-FDUMP-DEVICE-CODE-WIN-CWD-NEW-OFFLOAD: clang-linker-wrapper{{.*}} "-sycl-dump-device-code="

0 commit comments

Comments
 (0)