diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index dbb941e013e71..91dbfb631f1ff 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3544,7 +3544,7 @@ def fsycl_esimd : Flag<["-"], "fsycl-explicit-simd">, Group, Flags<[ HelpText<"Enable SYCL explicit SIMD extension">; def fno_sycl_esimd : Flag<["-"], "fno-sycl-explicit-simd">, Group, HelpText<"Disable SYCL explicit SIMD extension">, Flags<[NoArgumentUnused, CoreOption]>; -defm sycl_std_optimizations : OptOutFFlag<"sycl-std-optimizations", "Enable", "Disable", " standard optimization pipeline for SYCL device compiler">; +defm sycl_early_optimizations : OptOutFFlag<"sycl-early-optimizations", "Enable", "Disable", " standard optimization pipeline for SYCL device compiler">; //===----------------------------------------------------------------------===// // CC1 Options diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 918f2cafd8553..b60830af55750 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4103,9 +4103,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, false)) CmdArgs.push_back("-fsycl-explicit-simd"); - if (!Args.hasFlag(options::OPT_fsycl_std_optimizations, - options::OPT_fno_sycl_std_optimizations, true)) - CmdArgs.push_back("-fno-sycl-std-optimizations"); + if (!Args.hasFlag(options::OPT_fsycl_early_optimizations, + options::OPT_fno_sycl_early_optimizations, true)) + CmdArgs.push_back("-fno-sycl-early-optimizations"); else if (RawTriple.isSPIR()) { // Set `sycl-opt` option to configure LLVM passes for SPIR target CmdArgs.push_back("-mllvm"); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 7b02612490888..010383c1d5f52 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -823,7 +823,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.DisableLLVMPasses = Args.hasArg(OPT_disable_llvm_passes) || (Args.hasArg(OPT_fsycl_is_device) && Triple.isSPIR() && - Args.hasArg(OPT_fno_sycl_std_optimizations) && !IsSyclESIMD); + Args.hasArg(OPT_fno_sycl_early_optimizations) && !IsSyclESIMD); Opts.DisableLifetimeMarkers = Args.hasArg(OPT_disable_lifetimemarkers); const llvm::Triple::ArchType DebugEntryValueArchs[] = { diff --git a/clang/test/CodeGenSYCL/remove-ur-inst.cpp b/clang/test/CodeGenSYCL/remove-ur-inst.cpp index cf70f7c61f435..77792438d4811 100644 --- a/clang/test/CodeGenSYCL/remove-ur-inst.cpp +++ b/clang/test/CodeGenSYCL/remove-ur-inst.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsycl -fsycl-is-device -fno-sycl-std-optimizations -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fsycl -fsycl-is-device -fno-sycl-early-optimizations -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s SYCL_EXTERNAL void doesNotReturn() throw() __attribute__((__noreturn__)); diff --git a/clang/test/Driver/sycl-device-optimizations.cpp b/clang/test/Driver/sycl-device-optimizations.cpp index d945bfa09f0d8..dd6aa3524ec09 100644 --- a/clang/test/Driver/sycl-device-optimizations.cpp +++ b/clang/test/Driver/sycl-device-optimizations.cpp @@ -3,12 +3,12 @@ // RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s // RUN: %clang -### -fsycl -fsycl-device-only %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s -// CHECK-DEFAULT-NOT: "-fno-sycl-std-optimizations" +// CHECK-DEFAULT-NOT: "-fno-sycl-early-optimizations" // CHECK-DEFAULT-NOT: "-disable-llvm-passes" -/// Check "-fno-sycl-std-optimizations" is passed to the front-end: -// RUN: %clang -### -fsycl -fno-sycl-std-optimizations %s 2>&1 \ +/// Check "-fno-sycl-early-optimizations" is passed to the front-end: +// RUN: %clang -### -fsycl -fno-sycl-early-optimizations %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-STD-OPTS %s -// RUN: %clang -### -fsycl -fsycl-device-only -fno-sycl-std-optimizations %s 2>&1 \ +// RUN: %clang -### -fsycl -fsycl-device-only -fno-sycl-early-optimizations %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-STD-OPTS %s -// CHECK-NO-SYCL-STD-OPTS: "-fno-sycl-std-optimizations" \ No newline at end of file +// CHECK-NO-SYCL-STD-OPTS: "-fno-sycl-early-optimizations" \ No newline at end of file diff --git a/sycl/test/basic_tests/accessor/accessor.cpp b/sycl/test/basic_tests/accessor/accessor.cpp index 08b647b15f210..8ce78c67a1966 100644 --- a/sycl/test/basic_tests/accessor/accessor.cpp +++ b/sycl/test/basic_tests/accessor/accessor.cpp @@ -1,7 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/basic_tests/boolean.cpp b/sycl/test/basic_tests/boolean.cpp index d8adee7652666..dec4aec312ed7 100644 --- a/sycl/test/basic_tests/boolean.cpp +++ b/sycl/test/basic_tests/boolean.cpp @@ -1,7 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/basic_tests/stream/stream.cpp b/sycl/test/basic_tests/stream/stream.cpp index 7d9f8889c38d0..7204a56f58de3 100644 --- a/sycl/test/basic_tests/stream/stream.cpp +++ b/sycl/test/basic_tests/stream/stream.cpp @@ -1,7 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s // RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER // RUN: %GPU_RUN_ON_LINUX_PLACEHOLDER %t.out %GPU_CHECK_ON_LINUX_PLACEHOLDER diff --git a/sycl/test/check_device_code/fpga_ihs_float.cpp b/sycl/test/check_device_code/fpga_ihs_float.cpp index d12f48b168ae6..76f74187a89a2 100644 --- a/sycl/test/check_device_code/fpga_ihs_float.cpp +++ b/sycl/test/check_device_code/fpga_ihs_float.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // RUN: %clangxx -I %sycl_include -S -emit-llvm -fsycl -fsycl-device-only %s -o - | FileCheck %s -// RUN: %clangxx -I %sycl_include -S -emit-llvm -fsycl -fno-sycl-std-optimizations -fsycl-device-only %s -o - | FileCheck %s +// RUN: %clangxx -I %sycl_include -S -emit-llvm -fsycl -fno-sycl-early-optimizations -fsycl-device-only %s -o - | FileCheck %s #include "CL/__spirv/spirv_ops.hpp" diff --git a/sycl/test/fpga_tests/fpga_lsu.cpp b/sycl/test/fpga_tests/fpga_lsu.cpp index fda4ac5e3b60a..ea85dbff49c90 100644 --- a/sycl/test/fpga_tests/fpga_lsu.cpp +++ b/sycl/test/fpga_tests/fpga_lsu.cpp @@ -1,7 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations %s -o %t.out // RUNx: %ACC_RUN_PLACEHOLDER %t.out //==----------------- fpga_lsu.cpp - SYCL FPGA LSU test --------------------==// // diff --git a/sycl/test/hier_par/hier_par_wgscope.cpp b/sycl/test/hier_par/hier_par_wgscope.cpp index f2146241e911b..b0e58d305e1f5 100644 --- a/sycl/test/hier_par/hier_par_wgscope.cpp +++ b/sycl/test/hier_par/hier_par_wgscope.cpp @@ -1,7 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/regression/group.cpp b/sycl/test/regression/group.cpp index 0ecd8c569df9f..70748b741d773 100644 --- a/sycl/test/regression/group.cpp +++ b/sycl/test/regression/group.cpp @@ -1,7 +1,7 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/spec_const/spec_const_hw.cpp b/sycl/test/spec_const/spec_const_hw.cpp index c2a0bf168a5cc..c9450a451d2c6 100644 --- a/sycl/test/spec_const/spec_const_hw.cpp +++ b/sycl/test/spec_const/spec_const_hw.cpp @@ -1,9 +1,9 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda || level_zero // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/generic-shuffle.cpp b/sycl/test/sub_group/generic-shuffle.cpp index 18c1cfa08a50b..3cab0b9edbd7a 100644 --- a/sycl/test/sub_group/generic-shuffle.cpp +++ b/sycl/test/sub_group/generic-shuffle.cpp @@ -1,10 +1,10 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/generic_reduce.cpp b/sycl/test/sub_group/generic_reduce.cpp index 1c7df6a9f7619..7dda3a3492e57 100644 --- a/sycl/test/sub_group/generic_reduce.cpp +++ b/sycl/test/sub_group/generic_reduce.cpp @@ -1,11 +1,11 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-unnamed-lambda -std=c++14 %s -o %t.out -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple -std=c++14 -D SG_GPU %s -o %t_gpu.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-unnamed-lambda -std=c++14 %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple -std=c++14 -D SG_GPU %s -o %t_gpu.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t_gpu.out diff --git a/sycl/test/sub_group/load_store.cpp b/sycl/test/sub_group/load_store.cpp index 2c5d71c240f4f..3e818e7446ebf 100644 --- a/sycl/test/sub_group/load_store.cpp +++ b/sycl/test/sub_group/load_store.cpp @@ -1,4 +1,4 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda || cpu @@ -6,7 +6,7 @@ // #2252 Disable until all variants of built-ins are available in OpenCL CPU // runtime for every supported ISA // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/scan_fp16.cpp b/sycl/test/sub_group/scan_fp16.cpp index a837055a3aae7..13e3f45b27944 100644 --- a/sycl/test/sub_group/scan_fp16.cpp +++ b/sycl/test/sub_group/scan_fp16.cpp @@ -1,10 +1,10 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out //==--------------- scan_fp16.cpp - SYCL sub_group scan test --------*- C++ -*---==// diff --git a/sycl/test/sub_group/shuffle.cpp b/sycl/test/sub_group/shuffle.cpp index 6a93dfb83a003..b86b00dbf89b1 100644 --- a/sycl/test/sub_group/shuffle.cpp +++ b/sycl/test/sub_group/shuffle.cpp @@ -1,10 +1,10 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/sycl/test/sub_group/shuffle_fp16.cpp b/sycl/test/sub_group/shuffle_fp16.cpp index c48795702308f..930035d37a674 100644 --- a/sycl/test/sub_group/shuffle_fp16.cpp +++ b/sycl/test/sub_group/shuffle_fp16.cpp @@ -1,10 +1,10 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // //==------------ shuffle_fp16.cpp - SYCL sub_group shuffle test -----*- C++ -*---==// diff --git a/sycl/test/sub_group/shuffle_fp64.cpp b/sycl/test/sub_group/shuffle_fp64.cpp index c6465f1ec7917..3b5c3994cec87 100644 --- a/sycl/test/sub_group/shuffle_fp64.cpp +++ b/sycl/test/sub_group/shuffle_fp64.cpp @@ -1,10 +1,10 @@ -// TODO: Enable compilation w/o -fno-sycl-std-optimizations option. +// TODO: Enable compilation w/o -fno-sycl-early-optimizations option. // See https://github.com/intel/llvm/issues/2264 for more details. // UNSUPPORTED: cuda // CUDA compilation and runtime do not yet support sub-groups. // -// RUN: %clangxx -fsycl -fno-sycl-std-optimizations -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: %clangxx -fsycl -fno-sycl-early-optimizations -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out