Skip to content

[ESIMD] Deprecate -fsycl-explicit-simd option #3476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -4370,10 +4370,11 @@ def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption, CoreOption]>, Group<sycl
HelpText<"Enables SYCL kernels compilation for device">;
def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>, Group<sycl_Group>,
HelpText<"Disables SYCL kernels compilation for device">;
defm sycl_esimd: BoolFOption<"sycl-explicit-simd",
LangOpts<"SYCLExplicitSIMD">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
BothFlags<[NoArgumentUnused, CoreOption], "SYCL explicit SIMD extension.">>;
// FIXME: -fsycl-explicit-simd is deprecated. remove it when support is dropped.
def : Flag<["-"], "fsycl-explicit-simd">, Flags<[CoreOption]>, Group<clang_ignored_legacy_options_Group>,
HelpText<"Enable SYCL explicit SIMD extension. (deprecated)">;
def : Flag<["-"], "fno-sycl-explicit-simd">, Flags<[CoreOption]>, Group<clang_ignored_legacy_options_Group>,
HelpText<"Disable SYCL explicit SIMD extension. (deprecated)">;
defm sycl_early_optimizations : OptOutFFlag<"sycl-early-optimizations", "Enable", "Disable", " standard optimization pipeline for SYCL device compiler", [CoreOption]>;
def fsycl_dead_args_optimization : Flag<["-"], "fsycl-dead-args-optimization">,
Group<sycl_Group>, Flags<[NoArgumentUnused, CoreOption]>, HelpText<"Enables "
Expand Down
8 changes: 0 additions & 8 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4344,10 +4344,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fsycl-is-device");
CmdArgs.push_back("-fdeclare-spirv-builtins");

if (Args.hasFlag(options::OPT_fsycl_esimd, options::OPT_fno_sycl_esimd,
false))
CmdArgs.push_back("-fsycl-explicit-simd");

// Default value for FPGA is false, for all other targets is true.
if (!Args.hasFlag(options::OPT_fsycl_early_optimizations,
options::OPT_fno_sycl_early_optimizations,
Expand Down Expand Up @@ -6638,10 +6634,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// doing the host pass.
CmdArgs.push_back("-fsycl-is-host");

if (Args.hasFlag(options::OPT_fsycl_esimd, options::OPT_fno_sycl_esimd,
false))
CmdArgs.push_back("-fsycl-explicit-simd");

if (!D.IsCLMode()) {
// SYCL library is guaranteed to work correctly only with dynamic
// MSVC runtime.
Expand Down
14 changes: 4 additions & 10 deletions clang/test/Driver/sycl-esimd.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/// Check that explicit SIMD extension is disabled by default:
// RUN: %clang -### %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
// CHECK-DEFAULT-NOT: "-fsycl-explicit-simd"

/// Check "-fsycl-explicit-simd" is passed when compiling for device and host:
// RUN: %clang -### -fsycl -fsycl-explicit-simd %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-SYCL-ESIMD %s
// CHECK-SYCL-ESIMD: "-cc1"{{.*}} "-fsycl-explicit-simd"{{.*}}
// CHECK-SYCL-ESIMD: "-cc1"{{.*}} "-fsycl-explicit-simd"{{.*}}
/// Check that the warning is emmited for using "-fsycl-explicit-simd"
// RUN: %clang -### -fsycl-explicit-simd %s 2>&1 | FileCheck %s
// RUN: %clang -### -fno-sycl-explicit-simd %s 2>&1 | FileCheck %s
// CHECK: the flag '-f{{.*}}sycl-explicit-simd' has been deprecated and will be ignored
1 change: 0 additions & 1 deletion clang/test/Driver/sycl-offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@

/// Check "-spirv-allow-unknown-intrinsics=llvm.genx." option is emitted for llvm-spirv tool
// RUN: %clangxx %s -fsycl -### 2>&1 | FileCheck %s --check-prefix=CHK-ALLOW-INTRIN
// RUN: %clangxx %s -fsycl -fsycl-explicit-simd -### 2>&1 | FileCheck %s --check-prefix=CHK-ALLOW-INTRIN
// CHK-ALLOW-INTRIN: llvm-spirv{{.*}}-spirv-allow-unknown-intrinsics=llvm.genx.

/// ###########################################################################
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaSYCL/esimd-globals-in-sycl-context.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -fsycl-is-device -fsycl-explicit-simd -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s

// This test checks usage of an ESIMD global in ESIMD(positive) and SYCL(negative) contexts.

Expand Down
5 changes: 5 additions & 0 deletions sycl/doc/UsersManual.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ and not recommended to use in production environment.
Enables/Disables unnamed SYCL lambda kernels support.
Disabled by default.

**`-f[no-]sycl-explicit-simd`** [DEPRECATED]

The option was used to enable/disable SYCL explicit SIMD extension.
Not used anymore.

## Optimization options

**`-f[no-]sycl-early-optimizations`**
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/block_load_store.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/esimd-util-compiler-eval.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -c %s
// RUN: %clangxx -fsycl -fsycl-device-only -c %s
// This test checks compile-time evaluation of functions from esimd_util.hpp

#include "CL/sycl.hpp"
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/esimd_math.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/flat_atomic.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/gather4_scatter4.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/gather_scatter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/glob.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -c -fsycl-device-only -Xclang -emit-llvm %s -o %t
// RUN: %clangxx -fsycl -c -fsycl-device-only -Xclang -emit-llvm %s -o %t
// RUN: sycl-post-link -split-esimd -lower-esimd -O2 -S %t -o %t.table
// RUN: FileCheck %s -input-file=%t_esimd_0.ll

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/global_var.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s

#include <CL/sycl.hpp>
#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/hw_compile.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Basic ESIMD test which checks that ESIMD invocation syntax can get compiled.
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -c %s -o %t.bc
// RUN: %clangxx -fsycl -fsycl-device-only -c %s -o %t.bc

#include <CL/sycl.hpp>
#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/intrins_trans.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -O0 -fsycl -fsycl-explicit-simd -fsycl-device-only -Xclang -emit-llvm %s -o %t
// RUN: %clangxx -O0 -fsycl -fsycl-device-only -Xclang -emit-llvm %s -o %t
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table
// RUN: FileCheck %s -input-file=%t_esimd_0.ll

Expand Down
6 changes: 3 additions & 3 deletions sycl/test/esimd/odr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// Template functions must have the same instantiation in both sources to cause
// ODR problems potentially - esimd_min is used for that purpose.
//
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-targets=%sycl_triple -DSOURCE1 -c %s -o %t1.o
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-targets=%sycl_triple -DSOURCE2 -c %s -o %t2.o
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-targets=%sycl_triple %t1.o %t2.o -o %t.exe
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DSOURCE1 -c %s -o %t1.o
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DSOURCE2 -c %s -o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %t1.o %t2.o -o %t.exe
//
// Cuda does not support intrinsics generated by the ESIMD compilation path:
// UNSUPPORTED: cuda
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/simd.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/simd_merge.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/simd_view.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/slm_atomic.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/slm_block.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/slm_load.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/slm_load4.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -fsyntax-only -Xclang -verify %s
// RUN: %clangxx -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics

#include <CL/sycl.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/esimd/spirv_intrins_trans.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd -fsycl-device-only -S -emit-llvm -x c++ %s -o %t
// RUN: %clangxx -fsycl -fsycl-device-only -S -emit-llvm -x c++ %s -o %t
// RUN: sycl-post-link -split-esimd -lower-esimd -O0 -S %t -o %t.table
// RUN: FileCheck %s -input-file=%t_esimd_0.ll

Expand Down
6 changes: 3 additions & 3 deletions sycl/test/esimd/vadd.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// RUN: %clangxx -fsycl -fsycl-explicit-simd %s -o %t.out
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: %RUN_ON_HOST %t.out

// Check that the code compiles with -O0 and -g
// RUN: %clangxx -I %sycl_include %s -o %t.out -fsycl -fsycl-explicit-simd -O0
// RUN: %clangxx -I %sycl_include %s -o %t.out -fsycl -fsycl-explicit-simd -O0 -g
// RUN: %clangxx -I %sycl_include %s -o %t.out -fsycl -O0
// RUN: %clangxx -I %sycl_include %s -o %t.out -fsycl -O0 -g

#include <CL/sycl.hpp>
#include <CL/sycl/INTEL/esimd.hpp>
Expand Down
4 changes: 0 additions & 4 deletions sycl/test/on-device/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ def getDeviceCount(device_type):
if platform.system() == "Linux":
gpu_run_on_linux_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu ".format(SYCL_PLUGIN=backend)
gpu_check_on_linux_substitute = "| FileCheck %s"
# ESIMD-specific setup. Requires OpenCL for now.
esimd_run_substitute = " env SYCL_DEVICE_FILTER=opencl:gpu SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen"
config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) )
config.substitutions.append( ('%clangxx-esimd', "clang++ -fsycl-explicit-simd" ) )
else:
lit_config.warning("GPU device not found")

Expand Down