Skip to content

Commit 573f3c9

Browse files
Merge branch 'intel:sycl' into shuoniu-br-template-list
2 parents 5498834 + 1dea757 commit 573f3c9

File tree

3,736 files changed

+200780
-138812
lines changed

Some content is hidden

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

3,736 files changed

+200780
-138812
lines changed

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#
2323
# Please keep this file sorted.
2424

25+
26+
2527
2628
2729
@@ -30,3 +32,4 @@ Jon Roelofs <[email protected]> Jon Roelofs <[email protected]>
3032
Jon Roelofs <[email protected]> Jonathan Roelofs <[email protected]>
3133
Jon Roelofs <[email protected]> Jonathan Roelofs <[email protected]>
3234
Martin Storsjö <[email protected]>
35+
Saleem Abdulrasool <[email protected]> <[email protected]>

buildbot/configure.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def do_configure(args):
2626
libclc_targets_to_build = ''
2727
sycl_build_pi_cuda = 'OFF'
2828
sycl_build_pi_esimd_cpu = 'ON'
29+
sycl_build_pi_rocm = 'OFF'
2930
sycl_werror = 'ON'
3031
llvm_enable_assertions = 'ON'
3132
llvm_enable_doxygen = 'OFF'
@@ -47,6 +48,14 @@ def do_configure(args):
4748

4849
if args.disable_esimd_cpu:
4950
sycl_build_pi_esimd_cpu = 'OFF'
51+
52+
if args.rocm:
53+
llvm_targets_to_build += ';AMDGPU'
54+
# TODO libclc should be added once,
55+
# TODO when we build DPC++ with both CUDA and ROCM support
56+
llvm_enable_projects += ';libclc'
57+
libclc_targets_to_build = 'amdgcn--;amdgcn--amdhsa'
58+
sycl_build_pi_rocm = 'ON'
5059

5160
if args.no_werror:
5261
sycl_werror = 'OFF'
@@ -82,6 +91,7 @@ def do_configure(args):
8291
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
8392
"-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build),
8493
"-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda),
94+
"-DSYCL_BUILD_PI_ROCM={}".format(sycl_build_pi_rocm),
8595
"-DLLVM_BUILD_TOOLS=ON",
8696
"-DSYCL_ENABLE_WERROR={}".format(sycl_werror),
8797
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
@@ -151,6 +161,7 @@ def main():
151161
parser.add_argument("-t", "--build-type",
152162
metavar="BUILD_TYPE", default="Release", help="build type: Debug, Release")
153163
parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA")
164+
parser.add_argument("--rocm", action='store_true', help="swith from OpenCL to ROCM")
154165
parser.add_argument("--arm", action='store_true', help="build ARM support rather than x86")
155166
parser.add_argument("--disable-esimd-cpu", action='store_true', help="build without ESIMD_CPU support")
156167
parser.add_argument("--no-assertions", action='store_true', help="build without assertions")

buildbot/dependency.conf

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[VERSIONS]
2-
# https://github.com/intel/llvm/releases/download/2021-WW11/oclcpuexp-2021.11.3.0.09_rel.tar.gz
3-
ocl_cpu_rt_ver=2021.11.3.0.09
4-
# https://github.com/intel/llvm/releases/download/2021-WW11/win-oclcpuexp-2021.11.3.0.09_rel.zip
5-
ocl_cpu_rt_ver_win=2021.11.3.0.09
2+
# https://github.com/intel/llvm/releases/download/2021-WW26/oclcpuexp-2021.12.6.0.19_rel.tar.gz
3+
ocl_cpu_rt_ver=2021.12.6.0.19
4+
# https://github.com/intel/llvm/releases/download/2021-WW26/win-oclcpuexp-2021.12.6.0.19_rel.zip
5+
ocl_cpu_rt_ver_win=2021.12.6.0.19
66
# Same GPU driver supports Level Zero and OpenCL
7-
# https://github.com/intel/compute-runtime/releases/tag/21.19.19792
8-
ocl_gpu_rt_ver=21.19.19792
7+
# https://github.com/intel/compute-runtime/releases/tag/21.24.20098
8+
ocl_gpu_rt_ver=21.24.20098
99
# Same GPU driver supports Level Zero and OpenCL
1010
# https://downloadmirror.intel.com/30381/a08/igfx_win10_100.9466.zip
1111
ocl_gpu_rt_ver_win=27.20.100.9466
@@ -14,26 +14,26 @@ intel_sycl_ver=build
1414
# TBB binaries can be built from sources following instructions under
1515
# https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md
1616
# or downloaded using links below:
17-
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-lin.tgz
18-
tbb_ver=2021.2.0.236
19-
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-win.zip
20-
tbb_ver_win=2021.2.0.221
17+
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.2.0/oneapi-tbb-2021.2.0-lin.tgz
18+
tbb_ver=2021.3.0.418
19+
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.2.0/oneapi-tbb-2021.2.0-win.zip
20+
tbb_ver_win=2021.3.0.418
2121

22-
# https://github.com/intel/llvm/releases/download/2021-WW11/fpgaemu-2021.11.3.0.09_rel.tar.gz
23-
ocl_fpga_emu_ver=2021.11.3.0.09
24-
# https://github.com/intel/llvm/releases/download/2021-WW11/win-fpgaemu-2021.11.3.0.09_rel.zip
25-
ocl_fpga_emu_ver_win=2021.11.3.0.09
26-
fpga_ver=20210205_000003
27-
fpga_ver_win=20210204_000003_signed_bom_fixed
22+
# https://github.com/intel/llvm/releases/download/2021-WW26/fpgaemu-2021.12.6.0.19_rel.tar.gz
23+
ocl_fpga_emu_ver=2021.12.6.0.19
24+
# https://github.com/intel/llvm/releases/download/2021-WW26/win-fpgaemu-2021.12.6.0.19_rel.zip
25+
ocl_fpga_emu_ver_win=2021.12.6.0.19
26+
fpga_ver=20210519_000004
27+
fpga_ver_win=20210509_000006
2828
ocloc_ver_win=27.20.100.9168
2929

3030
[DRIVER VERSIONS]
31-
cpu_driver_lin=2021.11.3.0.09
32-
cpu_driver_win=2021.11.3.0.09
33-
gpu_driver_lin=21.19.19792
31+
cpu_driver_lin=2021.12.6.0.19
32+
cpu_driver_win=2021.12.6.0.19
33+
gpu_driver_lin=21.24.20098
3434
gpu_driver_win=27.20.100.9466
35-
fpga_driver_lin=2021.11.3.0.09
36-
fpga_driver_win=2021.11.3.0.09
35+
fpga_driver_lin=2021.12.6.0.19
36+
fpga_driver_win=2021.12.6.0.19
3737
# NVidia CUDA driver
3838
# TODO provide URL for CUDA driver
3939
nvidia_gpu_driver_lin=435.21

clang-tools-extra/clang-tidy/ClangTidyCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ llvm::Optional<int64_t> ClangTidyCheck::OptionsView::getEnumInt(
150150
unsigned EditDistance = 3;
151151
for (const auto &NameAndEnum : Mapping) {
152152
if (IgnoreCase) {
153-
if (Value.equals_lower(NameAndEnum.second))
153+
if (Value.equals_insensitive(NameAndEnum.second))
154154
return NameAndEnum.first;
155155
} else if (Value.equals(NameAndEnum.second)) {
156156
return NameAndEnum.first;
157-
} else if (Value.equals_lower(NameAndEnum.second)) {
157+
} else if (Value.equals_insensitive(NameAndEnum.second)) {
158158
Closest = NameAndEnum.second;
159159
EditDistance = 0;
160160
continue;

clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ void KernelNameRestrictionPPCallbacks::InclusionDirective(
7070

7171
bool KernelNameRestrictionPPCallbacks::fileNameIsRestricted(
7272
StringRef FileName) {
73-
return FileName.equals_lower("kernel.cl") ||
74-
FileName.equals_lower("verilog.cl") ||
75-
FileName.equals_lower("vhdl.cl");
73+
return FileName.equals_insensitive("kernel.cl") ||
74+
FileName.equals_insensitive("verilog.cl") ||
75+
FileName.equals_insensitive("vhdl.cl");
7676
}
7777

7878
void KernelNameRestrictionPPCallbacks::EndOfMainFile() {

clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ static bool sameName(StringRef InComment, StringRef InDecl, bool StrictMode) {
176176
return InComment == InDecl;
177177
InComment = InComment.trim('_');
178178
InDecl = InDecl.trim('_');
179-
// FIXME: compare_lower only works for ASCII.
180-
return InComment.compare_lower(InDecl) == 0;
179+
// FIXME: compare_insensitive only works for ASCII.
180+
return InComment.compare_insensitive(InDecl) == 0;
181181
}
182182

183183
static bool looksLikeExpectMethod(const CXXMethodDecl *Expect) {

clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void PreferMemberInitializerCheck::check(
159159
if (S->getBeginLoc().isMacroID()) {
160160
StringRef MacroName = Lexer::getImmediateMacroName(
161161
S->getBeginLoc(), *Result.SourceManager, getLangOpts());
162-
if (MacroName.contains_lower("assert"))
162+
if (MacroName.contains_insensitive("assert"))
163163
return;
164164
}
165165
if (isControlStatement(S))

clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ void StaticAssertCheck::check(const MatchFinder::MatchResult &Result) {
104104

105105
StringRef FalseMacroName =
106106
Lexer::getImmediateMacroName(FalseLiteralLoc, SM, Opts);
107-
if (FalseMacroName.compare_lower("false") == 0 ||
108-
FalseMacroName.compare_lower("null") == 0)
107+
if (FalseMacroName.compare_insensitive("false") == 0 ||
108+
FalseMacroName.compare_insensitive("null") == 0)
109109
return;
110110
}
111111

clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "../utils/LexerUtils.h"
1313
#include "../utils/Matchers.h"
1414
#include "../utils/OptionsUtils.h"
15+
#include "clang/AST/Decl.h"
1516
#include "clang/Basic/Diagnostic.h"
1617

1718
namespace clang {
@@ -72,14 +73,14 @@ AST_MATCHER_FUNCTION(StatementMatcher, isConstRefReturningFunctionCall) {
7273
.bind(InitFunctionCallId);
7374
}
7475

75-
AST_MATCHER_FUNCTION(StatementMatcher, isInitializedFromReferenceToConst) {
76+
AST_MATCHER_FUNCTION(StatementMatcher, initializerReturnsReferenceToConst) {
7677
auto OldVarDeclRef =
7778
declRefExpr(to(varDecl(hasLocalStorage()).bind(OldVarDeclId)));
78-
return declStmt(has(varDecl(hasInitializer(
79+
return expr(
7980
anyOf(isConstRefReturningFunctionCall(), isConstRefReturningMethodCall(),
8081
ignoringImpCasts(OldVarDeclRef),
81-
ignoringImpCasts(unaryOperator(
82-
hasOperatorName("&"), hasUnaryOperand(OldVarDeclRef))))))));
82+
ignoringImpCasts(unaryOperator(hasOperatorName("&"),
83+
hasUnaryOperand(OldVarDeclRef)))));
8384
}
8485

8586
// This checks that the variable itself is only used as const, and also makes
@@ -106,18 +107,14 @@ static bool isInitializingVariableImmutable(const VarDecl &InitializingVar,
106107
if (!isa<ReferenceType, PointerType>(T))
107108
return true;
108109

109-
auto Matches =
110-
match(findAll(declStmt(has(varDecl(equalsNode(&InitializingVar))))
111-
.bind("declStmt")),
112-
BlockStmt, Context);
113-
// The reference or pointer is not initialized in the BlockStmt. We assume
114-
// its pointee is not modified then.
115-
if (Matches.empty())
110+
// The reference or pointer is not declared and hence not initialized anywhere
111+
// in the function. We assume its pointee is not modified then.
112+
if (!InitializingVar.isLocalVarDecl() || !InitializingVar.hasInit()) {
116113
return true;
114+
}
117115

118-
const auto *Initialization = selectFirst<DeclStmt>("declStmt", Matches);
119-
Matches =
120-
match(isInitializedFromReferenceToConst(), *Initialization, Context);
116+
auto Matches = match(initializerReturnsReferenceToConst(),
117+
*InitializingVar.getInit(), Context);
121118
// The reference is initialized from a free function without arguments
122119
// returning a const reference. This is a global immutable object.
123120
if (selectFirst<CallExpr>(InitFunctionCallId, Matches) != nullptr)

clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_COPY_INITIALIZATION_H
1111

1212
#include "../ClangTidyCheck.h"
13+
#include "clang/AST/Decl.h"
1314

1415
namespace clang {
1516
namespace tidy {

clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ bool nameMatch(StringRef L, StringRef R, bool Strict) {
9393
return L.empty() || R.empty() || L == R;
9494
// We allow two names if one is a prefix/suffix of the other, ignoring case.
9595
// Important special case: this is true if either parameter has no name!
96-
return L.startswith_lower(R) || R.startswith_lower(L) ||
97-
L.endswith_lower(R) || R.endswith_lower(L);
96+
return L.startswith_insensitive(R) || R.startswith_insensitive(L) ||
97+
L.endswith_insensitive(R) || R.endswith_insensitive(L);
9898
}
9999

100100
DifferingParamsContainer

clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ getNewSuffix(llvm::StringRef OldSuffix,
9393
// Else, find matching suffix, case-*insensitive*ly.
9494
auto NewSuffix = llvm::find_if(
9595
NewSuffixes, [OldSuffix](const std::string &PotentialNewSuffix) {
96-
return OldSuffix.equals_lower(PotentialNewSuffix);
96+
return OldSuffix.equals_insensitive(PotentialNewSuffix);
9797
});
9898
// Have a match, return it.
9999
if (NewSuffix != NewSuffixes.end())

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include "llvm/ADT/SmallVector.h"
6363
#include "llvm/ADT/StringExtras.h"
6464
#include "llvm/ADT/StringRef.h"
65+
#include "llvm/Support/Casting.h"
6566
#include "llvm/Support/Compiler.h"
6667
#include "llvm/Support/Debug.h"
6768
#include "llvm/Support/Error.h"
@@ -1679,7 +1680,7 @@ class CodeCompleteFlow {
16791680
C.SemaResult->Kind == CodeCompletionResult::RK_Macro) ||
16801681
(C.IndexResult &&
16811682
C.IndexResult->SymInfo.Kind == index::SymbolKind::Macro)) &&
1682-
!C.Name.startswith_lower(Filter->pattern()))
1683+
!C.Name.startswith_insensitive(Filter->pattern()))
16831684
return None;
16841685
return Filter->match(C.Name);
16851686
}
@@ -1910,6 +1911,13 @@ bool isIndexedForCodeCompletion(const NamedDecl &ND, ASTContext &ASTCtx) {
19101911
if (isExplicitTemplateSpecialization(&ND))
19111912
return false;
19121913

1914+
// Category decls are not useful on their own outside the interface or
1915+
// implementation blocks. Moreover, sema already provides completion for
1916+
// these, even if it requires preamble deserialization. So by excluding them
1917+
// from the index, we reduce the noise in all the other completion scopes.
1918+
if (llvm::isa<ObjCCategoryDecl>(&ND) || llvm::isa<ObjCCategoryImplDecl>(&ND))
1919+
return false;
1920+
19131921
if (InTopLevelScope(ND))
19141922
return true;
19151923

clang-tools-extra/clangd/CompileCommands.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "llvm/Support/MemoryBuffer.h"
2121
#include "llvm/Support/Path.h"
2222
#include "llvm/Support/Program.h"
23+
#include <string>
24+
#include <vector>
2325

2426
namespace clang {
2527
namespace clangd {
@@ -209,14 +211,20 @@ void CommandMangler::adjust(std::vector<std::string> &Cmd) const {
209211
Cmd = tooling::getStripPluginsAdjuster()(Cmd, "");
210212
Cmd = tooling::getClangSyntaxOnlyAdjuster()(Cmd, "");
211213

214+
std::vector<std::string> ToAppend;
212215
if (ResourceDir && !Has("-resource-dir"))
213-
Cmd.push_back(("-resource-dir=" + *ResourceDir));
216+
ToAppend.push_back(("-resource-dir=" + *ResourceDir));
214217

215218
// Don't set `-isysroot` if it is already set or if `--sysroot` is set.
216219
// `--sysroot` is a superset of the `-isysroot` argument.
217220
if (Sysroot && !Has("-isysroot") && !Has("--sysroot")) {
218-
Cmd.push_back("-isysroot");
219-
Cmd.push_back(*Sysroot);
221+
ToAppend.push_back("-isysroot");
222+
ToAppend.push_back(*Sysroot);
223+
}
224+
225+
if (!ToAppend.empty()) {
226+
Cmd = tooling::getInsertArgumentAdjuster(
227+
std::move(ToAppend), tooling::ArgumentInsertPosition::END)(Cmd, "");
220228
}
221229

222230
if (!Cmd.empty()) {
@@ -288,9 +296,9 @@ enum DriverMode : unsigned char {
288296
DriverMode getDriverMode(const std::vector<std::string> &Args) {
289297
DriverMode Mode = DM_GCC;
290298
llvm::StringRef Argv0 = Args.front();
291-
if (Argv0.endswith_lower(".exe"))
299+
if (Argv0.endswith_insensitive(".exe"))
292300
Argv0 = Argv0.drop_back(strlen(".exe"));
293-
if (Argv0.endswith_lower("cl"))
301+
if (Argv0.endswith_insensitive("cl"))
294302
Mode = DM_CL;
295303
for (const llvm::StringRef Arg : Args) {
296304
if (Arg == "--driver-mode=cl") {
@@ -504,7 +512,6 @@ void ArgStripper::process(std::vector<std::string> &Args) const {
504512
Args.resize(Write);
505513
}
506514

507-
508515
std::string printArgv(llvm::ArrayRef<llvm::StringRef> Args) {
509516
std::string Buf;
510517
llvm::raw_string_ostream OS(Buf);

clang-tools-extra/clangd/ConfigCompile.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "llvm/Support/Regex.h"
4848
#include "llvm/Support/SMLoc.h"
4949
#include "llvm/Support/SourceMgr.h"
50+
#include <algorithm>
5051
#include <string>
5152

5253
namespace clang {
@@ -270,7 +271,9 @@ struct FragmentCompiler {
270271
Add.push_back(std::move(*A));
271272
Out.Apply.push_back([Add(std::move(Add))](const Params &, Config &C) {
272273
C.CompileFlags.Edits.push_back([Add](std::vector<std::string> &Args) {
273-
Args.insert(Args.end(), Add.begin(), Add.end());
274+
// The point to insert at. Just append when `--` isn't present.
275+
auto It = llvm::find(Args, "--");
276+
Args.insert(It, Add.begin(), Add.end());
274277
});
275278
});
276279
}

clang-tools-extra/clangd/ConfigYAML.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class Parser {
169169

170170
void parse(Fragment::IndexBlock::ExternalBlock &F,
171171
Located<std::string> ExternalVal) {
172-
if (!llvm::StringRef(*ExternalVal).equals_lower("none")) {
172+
if (!llvm::StringRef(*ExternalVal).equals_insensitive("none")) {
173173
error("Only scalar value supported for External is 'None'",
174174
ExternalVal.Range);
175175
return;

0 commit comments

Comments
 (0)