Skip to content

Commit 693c3cf

Browse files
committed
Merge remote-tracking branch 'intel_llvm/sycl' into public_vklochkov_reduce_bit_or
2 parents 056af56 + 8f8d34c commit 693c3cf

File tree

227 files changed

+1664
-1322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+1664
-1322
lines changed

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,9 @@ def OpenMP : DiagGroup<"openmp", [
11331133
]>;
11341134

11351135
// SYCL warnings
1136-
def SyclStrict : DiagGroup<"sycl-strict">;
1136+
def Sycl2017Compat : DiagGroup<"sycl-2017-compat">;
1137+
def Sycl2020Compat : DiagGroup<"sycl-2020-compat">;
1138+
def SyclStrict : DiagGroup<"sycl-strict", [ Sycl2017Compat, Sycl2020Compat]>;
11371139
def SyclTarget : DiagGroup<"sycl-target">;
11381140

11391141
// Backend warnings.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11026,6 +11026,12 @@ def err_sycl_invalid_property_list_template_param : Error<
1102611026
"%select{property_list|property_list pack argument|buffer_location}0 "
1102711027
"template parameter must be a "
1102811028
"%select{parameter pack|type|non-negative integer}1">;
11029+
def warn_sycl_pass_by_value_deprecated
11030+
: Warning<"Passing kernel functions by value is deprecated in SYCL 2020">,
11031+
InGroup<Sycl2020Compat>;
11032+
def warn_sycl_pass_by_reference_future
11033+
: Warning<"Passing of kernel functions by reference is a SYCL 2020 extension">,
11034+
InGroup<Sycl2017Compat>;
1102911035
def warn_sycl_attibute_function_raw_ptr
1103011036
: Warning<"SYCL 1.2.1 specification does not allow %0 attribute applied "
1103111037
"to a function with a raw pointer "

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3550,7 +3550,7 @@ def fsycl_esimd : Flag<["-"], "fsycl-explicit-simd">, Group<sycl_Group>, Flags<[
35503550
HelpText<"Enable SYCL explicit SIMD extension">;
35513551
def fno_sycl_esimd : Flag<["-"], "fno-sycl-explicit-simd">, Group<sycl_Group>,
35523552
HelpText<"Disable SYCL explicit SIMD extension">, Flags<[NoArgumentUnused, CoreOption]>;
3553-
defm sycl_early_optimizations : OptOutFFlag<"sycl-early-optimizations", "Enable", "Disable", " standard optimization pipeline for SYCL device compiler">;
3553+
defm sycl_early_optimizations : OptOutFFlag<"sycl-early-optimizations", "Enable", "Disable", " standard optimization pipeline for SYCL device compiler", [CoreOption]>;
35543554

35553555
//===----------------------------------------------------------------------===//
35563556
// CC1 Options

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,6 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
916916

917917
std::unique_ptr<llvm::ToolOutputFile> ThinLinkOS, DwoOS;
918918

919-
// Clean-up SYCL device code if LLVM passes are disabled
920-
if (LangOpts.SYCLIsDevice && CodeGenOpts.DisableLLVMPasses)
921-
PerModulePasses.add(createDeadCodeEliminationPass());
922-
923919
// Eliminate dead arguments from SPIR kernels in SYCL environment.
924920
// 1. Run DAE when LLVM optimizations are applied as well.
925921
// 2. We cannot run DAE for ESIMD since the pointers to SPIR kernel

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,22 +1555,24 @@ void CodeGenModule::GenOpenCLArgMetadata(llvm::Function *Fn,
15551555
: llvm::ConstantAsMetadata::get(CGF->Builder.getInt32(-1)));
15561556
}
15571557

1558-
Fn->setMetadata("kernel_arg_addr_space",
1559-
llvm::MDNode::get(VMContext, addressQuals));
1560-
Fn->setMetadata("kernel_arg_access_qual",
1561-
llvm::MDNode::get(VMContext, accessQuals));
1562-
Fn->setMetadata("kernel_arg_type",
1563-
llvm::MDNode::get(VMContext, argTypeNames));
1564-
Fn->setMetadata("kernel_arg_base_type",
1565-
llvm::MDNode::get(VMContext, argBaseTypeNames));
1566-
Fn->setMetadata("kernel_arg_type_qual",
1567-
llvm::MDNode::get(VMContext, argTypeQuals));
1568-
if (getCodeGenOpts().EmitOpenCLArgMetadata)
1569-
Fn->setMetadata("kernel_arg_name",
1570-
llvm::MDNode::get(VMContext, argNames));
1571-
if (LangOpts.SYCLIsDevice)
1558+
if (LangOpts.SYCLIsDevice && !LangOpts.SYCLExplicitSIMD)
15721559
Fn->setMetadata("kernel_arg_buffer_location",
15731560
llvm::MDNode::get(VMContext, argSYCLBufferLocationAttr));
1561+
else {
1562+
Fn->setMetadata("kernel_arg_addr_space",
1563+
llvm::MDNode::get(VMContext, addressQuals));
1564+
Fn->setMetadata("kernel_arg_access_qual",
1565+
llvm::MDNode::get(VMContext, accessQuals));
1566+
Fn->setMetadata("kernel_arg_type",
1567+
llvm::MDNode::get(VMContext, argTypeNames));
1568+
Fn->setMetadata("kernel_arg_base_type",
1569+
llvm::MDNode::get(VMContext, argBaseTypeNames));
1570+
Fn->setMetadata("kernel_arg_type_qual",
1571+
llvm::MDNode::get(VMContext, argTypeQuals));
1572+
if (getCodeGenOpts().EmitOpenCLArgMetadata)
1573+
Fn->setMetadata("kernel_arg_name",
1574+
llvm::MDNode::get(VMContext, argNames));
1575+
}
15741576
}
15751577

15761578
/// Determines whether the language options require us to model

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,6 +2587,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
25872587
if (const Arg *A = Args.getLastArg(OPT_sycl_std_EQ)) {
25882588
Opts.SYCLVersion = llvm::StringSwitch<unsigned>(A->getValue())
25892589
.Cases("2017", "1.2.1", "121", "sycl-1.2.1", 2017)
2590+
.Case("2020", 2020)
25902591
.Default(0U);
25912592

25922593
if (Opts.SYCLVersion == 0U) {

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,13 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
463463

464464
if (LangOpts.SYCL) {
465465
// SYCL Version is set to a value when building SYCL applications
466-
if (LangOpts.SYCLVersion == 2017)
466+
if (LangOpts.SYCLVersion == 2017) {
467467
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121");
468+
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "201707");
469+
} else if (LangOpts.SYCLVersion == 2020) {
470+
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001");
471+
}
472+
468473
if (LangOpts.SYCLValueFitInMaxInt)
469474
Builder.defineMacro("__SYCL_ID_QUERIES_FIT_IN_INT__", "1");
470475
}

0 commit comments

Comments
 (0)