Skip to content

Commit fc1aada

Browse files
committed
Merge branch 'sycl' of https://github.com/intel/llvm into properties
2 parents be7f99f + 26d5d98 commit fc1aada

File tree

127 files changed

+2630
-3030
lines changed

Some content is hidden

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

127 files changed

+2630
-3030
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ sycl/include/sycl/ext/intel/esimd.hpp @intel/dpcpp-esimd-reviewers
6060
sycl/doc/extensions/experimental/sycl_ext_intel_esimd/ @intel/dpcpp-esimd-reviewers
6161
llvm/lib/SYCLLowerIR/CMakeLists.txt @intel/dpcpp-tools-reviewers @intel/dpcpp-esimd-reviewers
6262

63+
# invoke_simd
64+
sycl/include/sycl/ext/oneapi/experimental/invoke_simd.hpp @rolandschulz @kbobrovs
65+
sycl/include/std/experimental/simd.hpp @rolandschulz @kbobrovs
66+
6367
# DevOps configs
6468
.github/workflows/ @intel/dpcpp-devops-reviewers
6569
buildbot/ @intel/dpcpp-devops-reviewers

buildbot/configure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def do_configure(args):
4444
sycl_enable_xpti_tracing = 'ON'
4545
xpti_enable_werror = 'OFF'
4646

47+
# lld is needed on Windows or for the HIP plugin on AMD
48+
if platform.system() == 'Windows' or (args.hip and args.hip_platform == 'AMD'):
49+
llvm_enable_projects += ';lld'
50+
4751
# replace not append, so ARM ^ X86
4852
if args.arm:
4953
llvm_targets_to_build = 'ARM;AArch64'
@@ -65,8 +69,6 @@ def do_configure(args):
6569
llvm_targets_to_build += ';AMDGPU'
6670
libclc_targets_to_build += libclc_amd_target_names
6771

68-
# The HIP plugin for AMD uses lld for linking
69-
llvm_enable_projects += ';lld'
7072
elif args.hip_platform == 'NVIDIA' and not args.cuda:
7173
llvm_targets_to_build += ';NVPTX'
7274
libclc_targets_to_build += libclc_nvidia_target_names

buildbot/dependency.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ocl_cpu_rt_ver=2022.14.8.0.04
44
# https://github.com/intel/llvm/releases/download/2022-WW33/win-oclcpuexp-2022.14.8.0.04_rel.zip
55
ocl_cpu_rt_ver_win=2022.14.8.0.04
66
# Same GPU driver supports Level Zero and OpenCL
7-
# https://github.com/intel/compute-runtime/releases/tag/22.31.23852
8-
ocl_gpu_rt_ver=22.31.23852
7+
# https://github.com/intel/compute-runtime/releases/tag/22.35.24055
8+
ocl_gpu_rt_ver=22.35.24055
99
# Same GPU driver supports Level Zero and OpenCL
1010
# https://downloadmirror.intel.com/723911/igfx_win_101.1404.zip
1111
ocl_gpu_rt_ver_win=101.1404
@@ -31,7 +31,7 @@ ocloc_ver_win=101.1404
3131
[DRIVER VERSIONS]
3232
cpu_driver_lin=2022.14.8.0.04
3333
cpu_driver_win=2022.14.8.0.04
34-
gpu_driver_lin=22.31.23852
34+
gpu_driver_lin=22.35.24055
3535
gpu_driver_win=101.1404
3636
fpga_driver_lin=2022.14.8.0.04
3737
fpga_driver_win=2022.14.8.0.04

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13982,7 +13982,7 @@ class Sema final {
1398213982
KernelConstStaticVariable
1398313983
};
1398413984

13985-
bool isKnownGoodSYCLDecl(const Decl *D);
13985+
bool isDeclAllowedInSYCLDeviceCode(const Decl *D);
1398613986
void checkSYCLDeviceVarDecl(VarDecl *Var);
1398713987
void copySYCLKernelAttrs(const CXXRecordDecl *KernelObj);
1398813988
void ConstructOpenCLKernel(FunctionDecl *KernelCallerFunc, MangleContext &MC);

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
16001600
StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin());
16011601
if (!getLangOpts().OptRecordFile.empty()) {
16021602
SyclOptReportHandler &SyclOptReport = CGM.getDiags().getSYCLOptReport();
1603-
if (Fn && SyclOptReport.HasOptReportInfo(FD)) {
1603+
if (SyclOptReport.HasOptReportInfo(FD)) {
16041604
llvm::OptimizationRemarkEmitter ORE(Fn);
16051605
for (auto ORI : llvm::enumerate(SyclOptReport.GetInfo(FD))) {
16061606
llvm::DiagnosticLocation DL =

clang/lib/Driver/ToolChains/MSVC.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
131131
CmdArgs.push_back("-defaultlib:oldnames");
132132
}
133133

134-
if ((!C.getDriver().IsCLMode() && !Args.hasArg(options::OPT_nostdlib) &&
135-
Args.hasArg(options::OPT_fsycl) &&
134+
if ((!C.getDriver().IsCLMode() && Args.hasArg(options::OPT_fsycl) &&
136135
!Args.hasArg(options::OPT_nolibsycl)) ||
137136
Args.hasArg(options::OPT_fsycl_host_compiler_EQ)) {
137+
CmdArgs.push_back(Args.MakeArgString(std::string("-libpath:") +
138+
TC.getDriver().Dir + "/../lib"));
138139
if (Args.hasArg(options::OPT__SLASH_MDd))
139140
CmdArgs.push_back("-defaultlib:sycld.lib");
140141
else

clang/lib/Sema/SemaChecking.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5967,8 +5967,8 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto,
59675967
CheckSYCLKernelCall(FD, Range, Args);
59685968

59695969
// Diagnose variadic calls in SYCL.
5970-
if (FD && FD ->isVariadic() && getLangOpts().SYCLIsDevice &&
5971-
!isUnevaluatedContext() && !isKnownGoodSYCLDecl(FD))
5970+
if (FD && FD->isVariadic() && getLangOpts().SYCLIsDevice &&
5971+
!isUnevaluatedContext() && !isDeclAllowedInSYCLDeviceCode(FD))
59725972
SYCLDiagIfDeviceCode(Loc, diag::err_sycl_restrict)
59735973
<< Sema::KernelCallVariadicFunction;
59745974
}

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,15 @@ static bool IsSyclMathFunc(unsigned BuiltinID) {
364364
return true;
365365
}
366366

367-
bool Sema::isKnownGoodSYCLDecl(const Decl *D) {
367+
bool Sema::isDeclAllowedInSYCLDeviceCode(const Decl *D) {
368368
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
369369
const IdentifierInfo *II = FD->getIdentifier();
370+
371+
// Allow __builtin_assume_aligned to be called from within device code.
372+
if (FD->getBuiltinID() &&
373+
FD->getBuiltinID() == Builtin::BI__builtin_assume_aligned)
374+
return true;
375+
370376
// Allow to use `::printf` only for CUDA.
371377
if (Context.getTargetInfo().getTriple().isNVPTX()) {
372378
if (FD->getBuiltinID() == Builtin::BIprintf)

clang/test/Driver/sycl-offload.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@
634634
// CHECK-LD-NOLIBSYCL: "{{.*}}ld{{(.exe)?}}"
635635
// CHECK-LD-NOLIBSYCL-NOT: "-lsycl"
636636

637+
/// Check no SYCL runtime is linked with -nostdlib
638+
// RUN: %clang -fsycl -nostdlib -target x86_64-unknown-linux-gnu %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LD-NOSTDLIB %s
639+
// CHECK-LD-NOSTDLIB: "{{.*}}ld{{(.exe)?}}"
640+
// CHECK-LD-NOSTDLIB-NOT: "-lsycl"
641+
637642
/// Check for default linking of sycl.lib with -fsycl usage
638643
// RUN: %clang -fsycl -target x86_64-unknown-windows-msvc %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-SYCL %s
639644
// RUN: %clang_cl -fsycl %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-SYCL-CL %s
@@ -643,11 +648,19 @@
643648

644649
/// Check no SYCL runtime is linked with -nolibsycl
645650
// RUN: %clang -fsycl -nolibsycl -target x86_64-unknown-windows-msvc %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOLIBSYCL %s
646-
// RUN: %clang_cl -fsycl -nolibsycl %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOLIBSYCL %s
647-
// CHECK-LINK-NOLIBSYCL-NOT: "--dependent-lib=sycl"
651+
// RUN: %clang_cl -fsycl -nolibsycl %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOLIBSYCL-CL %s
652+
// CHECK-LINK-NOLIBSYCL-CL-NOT: "--dependent-lib=sycl"
648653
// CHECK-LINK-NOLIBSYCL: "{{.*}}link{{(.exe)?}}"
649654
// CHECK-LINK-NOLIBSYCL-NOT: "-defaultlib:sycl.lib"
650655

656+
/// Check SYCL runtime is linked despite -nostdlib on Windows, this is
657+
/// necessary for the Windows Clang CMake to work
658+
// RUN: %clang -fsycl -nostdlib -target x86_64-unknown-windows-msvc %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOSTDLIB %s
659+
// RUN: %clang_cl -fsycl -nostdlib %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-NOSTDLIB-CL %s
660+
// CHECK-LINK-NOSTDLIB-CL: "--dependent-lib=sycl"
661+
// CHECK-LINK-NOSTDLIB: "{{.*}}link{{(.exe)?}}"
662+
// CHECK-LINK-NOSTDLIB: "-defaultlib:sycl.lib"
663+
651664
/// Check sycld.lib is chosen with /MDd
652665
// RUN: %clang_cl -fsycl /MDd %s -o %t -### 2>&1 | FileCheck -check-prefix=CHECK-LINK-SYCL-DEBUG %s
653666
// CHECK-LINK-SYCL-DEBUG: "--dependent-lib=sycld"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %clang_cc1 -fsycl-is-device -internal-isystem %S/Inputs -sycl-std=2020 -verify -fsyntax-only %s
2+
// This test checks if __builtin_assume_aligned does not throw an error when
3+
// called from within device code.
4+
5+
#include "sycl.hpp"
6+
7+
using namespace sycl;
8+
queue q;
9+
10+
int main() {
11+
int *Ptr[2];
12+
// expected-no-diagnostics
13+
q.submit([&](handler &h) {
14+
h.single_task<class kernelA>([=]() {
15+
int *APtr = (int *)__builtin_assume_aligned(Ptr, 32);
16+
*APtr = 42;
17+
});
18+
});
19+
return 0;
20+
}
21+

devops/actions/aws-ec2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "aws-ec2",
33
"description": "Start AWS EC2 spot instances with Github actions runner agent in it",
44
"dependencies": {
5-
"@actions/core": "1.9.0",
5+
"@actions/core": "1.9.1",
66
"@actions/github": "5.0.3",
77
"aws-sdk": "2.1179.0"
88
}

devops/dependencies.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"linux": {
33
"compute_runtime": {
4-
"github_tag": "22.32.23937",
5-
"version": "22.32.23937",
6-
"url": "https://github.com/intel/compute-runtime/releases/tag/22.32.23937",
4+
"github_tag": "22.35.24055",
5+
"version": "22.35.24055",
6+
"url": "https://github.com/intel/compute-runtime/releases/tag/22.35.24055",
77
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
88
},
99
"igc": {

devops/scripts/test-commit-sycl-bisect.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ fi
129129
cd "$TEST_WD"
130130
if [[ "$COMMAND_ALLOW_BISECT_CODES" == "" ]]; then
131131
bash -c "$COMMAND" || exit 1
132+
exit
132133
fi
133134

134135
# Otherwise, just run the command.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===---- SYCLPropagateAspectsUsage.cpp - SYCLPropagateAspectsUsage Pass --===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// Pass propagates optional kernel features metadata through a module call graph
10+
//
11+
//===----------------------------------------------------------------------===//
12+
//
13+
#ifndef LLVM_SYCL_PROPAGATE_ASPECTS_USAGE_H
14+
#define LLVM_SYCL_PROPAGATE_ASPECTS_USAGE_H
15+
16+
#include "llvm/IR/PassManager.h"
17+
18+
namespace llvm {
19+
20+
class SYCLPropagateAspectsUsagePass
21+
: public PassInfoMixin<SYCLPropagateAspectsUsagePass> {
22+
public:
23+
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
24+
};
25+
26+
} // namespace llvm
27+
28+
#endif // LLVM_SYCL_PROPAGATE_ASPECTS_USAGE_H

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#include "llvm/SYCLLowerIR/LowerWGLocalMemory.h"
8585
#include "llvm/SYCLLowerIR/LowerWGScope.h"
8686
#include "llvm/SYCLLowerIR/MutatePrintfAddrspace.h"
87+
#include "llvm/SYCLLowerIR/SYCLPropagateAspectsUsage.h"
8788
#include "llvm/Support/CommandLine.h"
8889
#include "llvm/Support/Debug.h"
8990
#include "llvm/Support/ErrorHandling.h"

llvm/lib/Passes/PassRegistry.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ MODULE_PASS("SPIRITTAnnotations", SPIRITTAnnotationsPass())
136136
MODULE_PASS("deadargelim-sycl", DeadArgumentEliminationSYCLPass())
137137
MODULE_PASS("sycllowerwglocalmemory", SYCLLowerWGLocalMemoryPass())
138138
MODULE_PASS("lower-esimd-kernel-attrs", SYCLFixupESIMDKernelWrapperMDPass())
139+
MODULE_PASS("sycl-propagate-aspects-usage", SYCLPropagateAspectsUsagePass())
139140
#undef MODULE_PASS
140141

141142
#ifndef MODULE_PASS_WITH_PARAMS

llvm/lib/SYCLLowerIR/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ add_llvm_component_library(LLVMSYCLLowerIR
5858
LowerWGScope.cpp
5959
LowerWGLocalMemory.cpp
6060
MutatePrintfAddrspace.cpp
61+
SYCLPropagateAspectsUsage.cpp
6162

6263
LocalAccessorToSharedMemory.cpp
6364
GlobalOffset.cpp

llvm/lib/SYCLLowerIR/LowerInvokeSimd.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,15 @@ bool collectUsesLookTrhoughMemAndCasts(Value *V,
250250
for (const Use *U : TmpVUses) {
251251
User *UU = U->getUser();
252252
assert(!isCast(UU));
253+
253254
auto *St = dyn_cast<StoreInst>(UU);
254255

255256
if (!St) {
256257
Uses.insert(U);
257258
continue;
258259
}
259260
// Current user is a store (of V) instruction, see if...
260-
assert((V = St->getValueOperand()) &&
261+
assert((V == St->getValueOperand()) &&
261262
"bad V param in collectUsesLookTrhoughMemAndCasts");
262263
Value *Addr = stripCasts(St->getPointerOperand());
263264

0 commit comments

Comments
 (0)