Skip to content

Commit 6dbefb5

Browse files
[Driver] Remove several ESIMD-specific options (#4419)
Previously those two options were controling splitting SYCL and ESIMD code in sycl-post-link and lowering ESIMD-specific constructs after that. If there is a mix of SYCL and ESIMD kernels in a program, and we do NOT split and lower ESIMD code then the resulting binary will be broken. If we only have one type of kernels (regular SYCL or ESIMD), then those two options will have no effect. So, users should never have a situation when they need to disable those two options, i.e. use `-fno-`. Since the default should never be overwritten, we can safely remove the options.
1 parent f821153 commit 6dbefb5

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,14 +2628,6 @@ def fsycl_device_code_split_EQ : Joined<["-"], "fsycl-device-code-split=">,
26282628
def fsycl_device_code_split : Flag<["-"], "fsycl-device-code-split">, Alias<fsycl_device_code_split_EQ>,
26292629
AliasArgs<["auto"]>, Flags<[CC1Option, CoreOption]>,
26302630
HelpText<"Perform SYCL device code split in the 'auto' mode, i.e. use heuristic to distribute device code across modules">;
2631-
def fsycl_device_code_split_esimd : Flag<["-"], "fsycl-device-code-split-esimd">,
2632-
Flags<[CC1Option, CoreOption]>, HelpText<"Split SYCL and ESIMD kernels into separate modules">;
2633-
def fno_sycl_device_code_split_esimd : Flag<["-"], "fno-sycl-device-code-split-esimd">,
2634-
Flags<[CC1Option, CoreOption]>, HelpText<"Don't split SYCL and ESIMD kernels into separate modules">;
2635-
def fsycl_device_code_lower_esimd : Flag<["-"], "fsycl-device-code-lower-esimd">,
2636-
Flags<[CC1Option, CoreOption]>, HelpText<"Lower ESIMD-specific constructs">;
2637-
def fno_sycl_device_code_lower_esimd : Flag<["-"], "fno-sycl-device-code-lower-esimd">,
2638-
Flags<[CC1Option, CoreOption]>, HelpText<"Do not lower ESIMD-specific constructs">;
26392631
def fsycl_instrument_device_code : Flag<["-"], "fsycl-instrument-device-code">,
26402632
Group<sycl_Group>, Flags<[CC1Option, CoreOption]>,
26412633
HelpText<"Add ITT instrumentation intrinsics calls">,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8945,13 +8945,8 @@ void SYCLPostLink::ConstructJob(Compilation &C, const JobAction &JA,
89458945
// Symbol file and specialization constant info generation is mandatory -
89468946
// add options unconditionally
89478947
addArgs(CmdArgs, TCArgs, {"-symbols"});
8948-
// By default we split SYCL and ESIMD kernels into separate modules
8949-
if (TCArgs.hasFlag(options::OPT_fsycl_device_code_split_esimd,
8950-
options::OPT_fno_sycl_device_code_split_esimd, true))
8951-
addArgs(CmdArgs, TCArgs, {"-split-esimd"});
8952-
if (TCArgs.hasFlag(options::OPT_fsycl_device_code_lower_esimd,
8953-
options::OPT_fno_sycl_device_code_lower_esimd, true))
8954-
addArgs(CmdArgs, TCArgs, {"-lower-esimd"});
8948+
addArgs(CmdArgs, TCArgs, {"-split-esimd"});
8949+
addArgs(CmdArgs, TCArgs, {"-lower-esimd"});
89558950
}
89568951
addArgs(CmdArgs, TCArgs,
89578952
{StringRef(getSYCLPostLinkOptimizationLevel(TCArgs))});

clang/test/Driver/sycl-offload-with-split.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -299,25 +299,15 @@
299299
// Check ESIMD device code split.
300300
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
301301
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
302-
// RUN: %clang -### -fsycl -fsycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
303-
// RUN: %clang_cl -### -fsycl -fsycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
304-
// RUN: %clang -### -fsycl -fno-sycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
305-
// RUN: %clang_cl -### -fsycl -fno-sycl-device-code-split-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-SPLIT
306302
// RUN: %clang -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
307303
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
308304
// RUN: %clang_cl -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
309305
// CHK-ESIMD-SPLIT: sycl-post-link{{.*}} "-split-esimd"
310-
// CHK-NO-ESIMD-SPLIT-NOT: sycl-post-link{{.*}} "-split-esimd"
311306

312307
// Check lowering of ESIMD device code.
313308
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
314309
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
315-
// RUN: %clang -### -fsycl -fsycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
316-
// RUN: %clang_cl -### -fsycl -fsycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
317-
// RUN: %clang -### -fsycl -fno-sycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
318-
// RUN: %clang_cl -### -fsycl -fno-sycl-device-code-lower-esimd %s 2>&1 | FileCheck %s -check-prefixes=CHK-NO-ESIMD-LOWER
319310
// RUN: %clang -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
320311
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
321312
// RUN: %clang_cl -### -fsycl -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
322313
// CHK-ESIMD-LOWER: sycl-post-link{{.*}} "-lower-esimd"
323-
// CHK-NO-ESIMD-LOWER-NOT: sycl-post-link{{.*}} "-lower-esimd"

0 commit comments

Comments
 (0)