Skip to content

Commit ba4e567

Browse files
authored
[Driver][SYCL] Correct optimization disabling option for gen (#2622)
When performing AOT for gen, we were passing the wrong optimization disabling option. Update to use -cl-opt-disable
1 parent e1e3962 commit ba4e567

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static void addImpliedArgs(const llvm::Triple &Triple,
510510
if (!A->getOption().matches(options::OPT_g0))
511511
BeArgs.push_back("-g");
512512
if (Args.getLastArg(options::OPT_O0))
513-
BeArgs.push_back(IsGen ? "-O0" : "-cl-opt-disable");
513+
BeArgs.push_back("-cl-opt-disable");
514514
if (BeArgs.empty())
515515
return;
516516
if (Triple.getSubArch() == llvm::Triple::NoSubArch ||

clang/test/Driver/sycl-offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@
758758
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-GEN %s
759759
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
760760
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-GEN %s
761-
// CHK-TOOLS-IMPLIED-OPTS-GEN: ocloc{{.*}} "-options" "-g -O0" "-DFOO1" "-DFOO2"
761+
// CHK-TOOLS-IMPLIED-OPTS-GEN: ocloc{{.*}} "-options" "-g -cl-opt-disable" "-DFOO1" "-DFOO2"
762762

763763
/// Check -Xsycl-target-linker option passing
764764
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xsycl-target-linker "-DFOO1 -DFOO2" %s 2>&1 \

0 commit comments

Comments
 (0)