Skip to content

Commit 5ccb6a4

Browse files
committed
Merge remote-tracking branch 'origin/sycl-web' into llvmspirv_pulldown
2 parents 3ce9126 + 9877091 commit 5ccb6a4

File tree

1,786 files changed

+67072
-23710
lines changed

Some content is hidden

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

1,786 files changed

+67072
-23710
lines changed

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
if [ "${{ inputs.use_dev_igc }}" = "true" ]; then
195195
sudo apt-get install -yqq libllvm14;
196196
fi
197-
sudo -E bash devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all ${{ inputs.use_dev_igc == 'true' && '--use-dev-igc' || '' }}
197+
sudo -E bash devops/scripts/install_drivers.sh llvm/devops/dependencies.json ${{ inputs.use_dev_igc == 'true' && 'llvm/devops/dependencies-igc-dev.json --use-dev-igc' || '' }} --all
198198
- name: Source OneAPI TBB vars.sh
199199
shell: bash
200200
run: |
@@ -300,23 +300,53 @@ jobs:
300300
if: inputs.tests_selector == 'cts'
301301
env:
302302
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }}
303+
# Continue execution if some category fails to build.
304+
shell: bash {0}
305+
# Compile each binary individually; if a failure occurs during the
306+
# 'test_all' build, the entire build will be affected.
303307
run: |
304308
cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER=$(which clang++) \
305309
-DSYCL_IMPLEMENTATION=DPCPP \
306310
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$PWD/devops/cts_exclude_filter" \
307311
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \
308312
-DSYCL_CTS_MEASURE_BUILD_TIMES=ON \
309-
-DDPCPP_INSTALL_DIR="$$(dirname (which clang++))/.." \
310-
$CMAKE_EXTRA_ARGS
311-
ninja -C build-cts
313+
-DDPCPP_INSTALL_DIR="$(dirname $(which clang++))/.." \
314+
$CMAKE_EXTRA_ARGS | tee "cmake_output.txt"
315+
316+
# Get names of all added test-categories:
317+
categories=$(grep -o '^-- Adding test: test_[a-zA-Z0-9_]*' "./cmake_output.txt" | sed 's/^-- Adding test: //')
318+
319+
number_of_test_categories=$(echo $categories | wc -w)
320+
iteration=1
321+
failed_to_build=""
322+
323+
for i in $categories; do
324+
echo "::group::Building $i ($iteration of $number_of_test_categories)"
325+
ninja -C build-cts $i
326+
[ $? -ne 0 ] && failed_to_build+=$i'\n'
327+
echo "::endgroup::"
328+
((iteration++))
329+
done
330+
331+
if [ -n "$failed_to_build" ]; then
332+
echo -e "Failed to build:\n$failed_to_build"
333+
echo -e "Failed to build:\n$failed_to_build" >> $GITHUB_STEP_SUMMARY
334+
exit 1
335+
fi
336+
337+
exit 0
312338
313339
- name: SYCL CTS List devices
314-
if: inputs.tests_selector == 'cts'
340+
# Proceed with execution even if the 'build' step did not succeed.
341+
if: inputs.tests_selector == 'cts' && (success() || failure())
342+
env:
343+
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
315344
run: |
316-
./build-cts/bin/test_all --list-devices
345+
./build-cts/bin/* --list-devices
317346
318347
- name: Run SYCL CTS tests
319-
if: inputs.tests_selector == 'cts'
348+
# Proceed with execution even if the previous two steps did not succeed.
349+
if: inputs.tests_selector == 'cts' && (success() || failure())
320350
env:
321351
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
322352
# This job takes ~100min usually. But sometimes some test isn't
@@ -329,33 +359,20 @@ jobs:
329359
# the default behavior.
330360
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell
331361
shell: bash {0}
332-
# FIXME: For some reason the "sub_group api" test-case is failing with
333-
# SIGSEGV while running test_all, so running each binary separately.
334-
# BTW test_all requires a lot of resources to build it, so probably it'll
335-
# be better to build each binary also separately.
336-
# run: |
337-
# ./build-cts/bin/test_all $CTS_TEST_ARGS
338362
run: |
339-
status=""
340363
failed_suites=""
364+
341365
for i in `ls -1 ./build-cts/bin`; do
342-
if [ "$i" != "test_all" ]; then
343-
echo "::group::Running $i"
344-
build-cts/bin/$i
345-
if [ $? -ne 0 ]; then
346-
status=1
347-
if [$failed_suites == ""]; then
348-
failed_suites=$i
349-
else
350-
failed_suites="$failed_suites, $i"
351-
fi
352-
fi
353-
echo "::endgroup::"
354-
fi
366+
echo "::group::Running $i"
367+
build-cts/bin/$i
368+
[ $? -ne 0 ] && failed_suites+=$i'\n'
369+
echo "::endgroup::"
355370
done
356-
if [ -n "$status" ]; then
357-
echo "Failed suite(s): $failed_suites"
358-
echo "Failed suite(s): $failed_suites" >> $GITHUB_STEP_SUMMARY
371+
372+
if [ -n "$failed_suites" ]; then
373+
echo -e "Failed suite(s): $failed_suites"
374+
echo -e "Failed suite(s): $failed_suites" >> $GITHUB_STEP_SUMMARY
359375
exit 1
360376
fi
377+
361378
exit 0

.github/workflows/sycl-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
target_devices: ext_oneapi_cuda:gpu
8282
tests_selector: e2e
8383

84-
- name: SYCL-CTS
84+
- name: SYCL-CTS on OCL CPU
8585
runner: '["Linux", "gen12"]'
8686
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
8787
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN

bolt/test/AArch64/constant_island_pie_update.s

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# RUN: llvm-objdump -j .text -d --show-all-symbols %t.relr.bolt | FileCheck %s
1919
# RUN: llvm-objdump -j .text -d %t.relr.bolt | \
2020
# RUN: FileCheck %s --check-prefix=ADDENDCHECK
21-
# RUN: llvm-readelf -rsW %t.relr.bolt | FileCheck --check-prefix=ELFCHECK %s
21+
# RUN: llvm-readelf -rsW %t.relr.bolt | FileCheck --check-prefix=RELRELFCHECK %s
2222
# RUN: llvm-readelf -SW %t.relr.bolt | FileCheck --check-prefix=RELRSZCHECK %s
2323

2424
// Check that the CI value was updated
@@ -51,6 +51,12 @@
5151
# ELFCHECK-NEXT: {{.*}} R_AARCH64_RELATIVE
5252
# ELFCHECK: {{.*}}[[#OFF]] {{.*}} $d
5353

54+
# RELRELFCHECK: $d{{$}}
55+
# RELRELFCHECK-NEXT: $d + 0x8{{$}}
56+
# RELRELFCHECK-NEXT: $d + 0x18{{$}}
57+
# RELRELFCHECK-NEXT: mytextP
58+
# RELRELFCHECK-EMPTY:
59+
5460
// Check that .relr.dyn size is 2 bytes to ensure that last 3 relocations were
5561
// encoded as a bitmap so the total section size for 3 relocations is 2 bytes.
5662
# RELRSZCHECK: .relr.dyn RELR [[#%x,ADDR:]] [[#%x,OFF:]] {{0*}}10

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
380380
this->SourceRoot = std::string(SourceRootDir);
381381
if (!RepositoryUrl.empty()) {
382382
this->RepositoryUrl = std::string(RepositoryUrl);
383-
if (!RepositoryUrl.empty() && RepositoryUrl.find("http://") != 0 &&
384-
RepositoryUrl.find("https://") != 0)
383+
if (!RepositoryUrl.empty() && !RepositoryUrl.starts_with("http://") &&
384+
!RepositoryUrl.starts_with("https://"))
385385
this->RepositoryUrl->insert(0, "https://");
386386
}
387387
}

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ static bool consumeNegativeIndicator(StringRef &GlobList) {
1919
return GlobList.consume_front("-");
2020
}
2121

22-
// Converts first glob from the comma-separated list of globs to Regex and
23-
// removes it and the trailing comma from the GlobList.
24-
static llvm::Regex consumeGlob(StringRef &GlobList) {
22+
// Extracts the first glob from the comma-separated list of globs,
23+
// removes it and the trailing comma from the GlobList and
24+
// returns the extracted glob.
25+
static llvm::StringRef extractNextGlob(StringRef &GlobList) {
2526
StringRef UntrimmedGlob = GlobList.substr(0, GlobList.find_first_of(",\n"));
2627
StringRef Glob = UntrimmedGlob.trim();
2728
GlobList = GlobList.substr(UntrimmedGlob.size() + 1);
29+
return Glob;
30+
}
31+
32+
static llvm::Regex createRegexFromGlob(StringRef &Glob) {
2833
SmallString<128> RegexText("^");
2934
StringRef MetaChars("()^$|*+?.[]\\{}");
3035
for (char C : Glob) {
@@ -43,7 +48,8 @@ GlobList::GlobList(StringRef Globs, bool KeepNegativeGlobs /* =true */) {
4348
do {
4449
GlobListItem Item;
4550
Item.IsPositive = !consumeNegativeIndicator(Globs);
46-
Item.Regex = consumeGlob(Globs);
51+
Item.Text = extractNextGlob(Globs);
52+
Item.Regex = createRegexFromGlob(Item.Text);
4753
if (Item.IsPositive || KeepNegativeGlobs)
4854
Items.push_back(std::move(Item));
4955
} while (!Globs.empty());

clang-tools-extra/clang-tidy/GlobList.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ class GlobList {
4444
struct GlobListItem {
4545
bool IsPositive;
4646
llvm::Regex Regex;
47+
llvm::StringRef Text;
4748
};
4849
SmallVector<GlobListItem, 0> Items;
50+
51+
public:
52+
const SmallVectorImpl<GlobListItem> &getItems() const { return Items; };
4953
};
5054

5155
/// A \p GlobList that caches search results, so that search is performed only

clang-tools-extra/clang-tidy/add_new_check.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def adapt_module(module_path, module, check_name, check_name_camel):
211211
f.write(check_decl)
212212
else:
213213
match = re.search(
214-
'registerCheck<(.*)> *\( *(?:"([^"]*)")?', line
214+
r'registerCheck<(.*)> *\( *(?:"([^"]*)")?', line
215215
)
216216
prev_line = None
217217
if match:
@@ -383,7 +383,7 @@ def filename_from_module(module_name, check_name):
383383
if stmt_start_pos == -1:
384384
return ""
385385
stmt = code[stmt_start_pos + 1 : stmt_end_pos]
386-
matches = re.search('registerCheck<([^>:]*)>\(\s*"([^"]*)"\s*\)', stmt)
386+
matches = re.search(r'registerCheck<([^>:]*)>\(\s*"([^"]*)"\s*\)', stmt)
387387
if matches and matches[2] == full_check_name:
388388
class_name = matches[1]
389389
if "::" in class_name:
@@ -401,8 +401,8 @@ def filename_from_module(module_name, check_name):
401401
# Examine code looking for a c'tor definition to get the base class name.
402402
def get_base_class(code, check_file):
403403
check_class_name = os.path.splitext(os.path.basename(check_file))[0]
404-
ctor_pattern = check_class_name + "\([^:]*\)\s*:\s*([A-Z][A-Za-z0-9]*Check)\("
405-
matches = re.search("\s+" + check_class_name + "::" + ctor_pattern, code)
404+
ctor_pattern = check_class_name + r"\([^:]*\)\s*:\s*([A-Z][A-Za-z0-9]*Check)\("
405+
matches = re.search(r"\s+" + check_class_name + "::" + ctor_pattern, code)
406406

407407
# The constructor might be inline in the header.
408408
if not matches:
@@ -476,7 +476,7 @@ def process_doc(doc_file):
476476
# Orphan page, don't list it.
477477
return "", ""
478478

479-
match = re.search(".*:http-equiv=refresh: \d+;URL=(.*).html(.*)", content)
479+
match = re.search(r".*:http-equiv=refresh: \d+;URL=(.*).html(.*)", content)
480480
# Is it a redirect?
481481
return check_name, match
482482

@@ -505,7 +505,7 @@ def format_link_alias(doc_file):
505505
ref_begin = ""
506506
ref_end = "_"
507507
else:
508-
redirect_parts = re.search("^\.\./([^/]*)/([^/]*)$", match.group(1))
508+
redirect_parts = re.search(r"^\.\./([^/]*)/([^/]*)$", match.group(1))
509509
title = redirect_parts[1] + "-" + redirect_parts[2]
510510
target = redirect_parts[1] + "/" + redirect_parts[2]
511511
autofix = has_auto_fix(title)

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
#include "LambdaFunctionNameCheck.h"
1010
#include "clang/AST/ASTContext.h"
11+
#include "clang/AST/DeclCXX.h"
1112
#include "clang/ASTMatchers/ASTMatchFinder.h"
13+
#include "clang/ASTMatchers/ASTMatchers.h"
1214
#include "clang/Frontend/CompilerInstance.h"
1315
#include "clang/Lex/MacroInfo.h"
1416
#include "clang/Lex/Preprocessor.h"
@@ -56,6 +58,8 @@ class MacroExpansionsWithFileAndLine : public PPCallbacks {
5658
LambdaFunctionNameCheck::SourceRangeSet* SuppressMacroExpansions;
5759
};
5860

61+
AST_MATCHER(CXXMethodDecl, isInLambda) { return Node.getParent()->isLambda(); }
62+
5963
} // namespace
6064

6165
LambdaFunctionNameCheck::LambdaFunctionNameCheck(StringRef Name,
@@ -69,9 +73,13 @@ void LambdaFunctionNameCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
6973
}
7074

7175
void LambdaFunctionNameCheck::registerMatchers(MatchFinder *Finder) {
72-
// Match on PredefinedExprs inside a lambda.
73-
Finder->addMatcher(predefinedExpr(hasAncestor(lambdaExpr())).bind("E"),
74-
this);
76+
Finder->addMatcher(
77+
cxxMethodDecl(isInLambda(),
78+
hasBody(forEachDescendant(
79+
predefinedExpr(hasAncestor(cxxMethodDecl().bind("fn")))
80+
.bind("E"))),
81+
equalsBoundNode("fn")),
82+
this);
7583
}
7684

7785
void LambdaFunctionNameCheck::registerPPCallbacks(

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -454,52 +454,27 @@ static constexpr StringLiteral VerifyConfigWarningEnd = " [-verify-config]\n";
454454

455455
static bool verifyChecks(const StringSet<> &AllChecks, StringRef CheckGlob,
456456
StringRef Source) {
457-
llvm::StringRef Cur, Rest;
457+
GlobList Globs(CheckGlob);
458458
bool AnyInvalid = false;
459-
for (std::tie(Cur, Rest) = CheckGlob.split(',');
460-
!(Cur.empty() && Rest.empty()); std::tie(Cur, Rest) = Rest.split(',')) {
461-
Cur = Cur.trim();
462-
if (Cur.empty())
459+
for (const auto &Item : Globs.getItems()) {
460+
if (Item.Text.starts_with("clang-diagnostic"))
463461
continue;
464-
Cur.consume_front("-");
465-
if (Cur.starts_with("clang-diagnostic"))
466-
continue;
467-
if (Cur.contains('*')) {
468-
SmallString<128> RegexText("^");
469-
StringRef MetaChars("()^$|*+?.[]\\{}");
470-
for (char C : Cur) {
471-
if (C == '*')
472-
RegexText.push_back('.');
473-
else if (MetaChars.contains(C))
474-
RegexText.push_back('\\');
475-
RegexText.push_back(C);
476-
}
477-
RegexText.push_back('$');
478-
llvm::Regex Glob(RegexText);
479-
std::string Error;
480-
if (!Glob.isValid(Error)) {
481-
AnyInvalid = true;
482-
llvm::WithColor::error(llvm::errs(), Source)
483-
<< "building check glob '" << Cur << "' " << Error << "'\n";
484-
continue;
485-
}
486-
if (llvm::none_of(AllChecks.keys(),
487-
[&Glob](StringRef S) { return Glob.match(S); })) {
488-
AnyInvalid = true;
462+
if (llvm::none_of(AllChecks.keys(),
463+
[&Item](StringRef S) { return Item.Regex.match(S); })) {
464+
AnyInvalid = true;
465+
if (Item.Text.contains('*'))
489466
llvm::WithColor::warning(llvm::errs(), Source)
490-
<< "check glob '" << Cur << "' doesn't match any known check"
467+
<< "check glob '" << Item.Text << "' doesn't match any known check"
491468
<< VerifyConfigWarningEnd;
469+
else {
470+
llvm::raw_ostream &Output =
471+
llvm::WithColor::warning(llvm::errs(), Source)
472+
<< "unknown check '" << Item.Text << '\'';
473+
llvm::StringRef Closest = closest(Item.Text, AllChecks);
474+
if (!Closest.empty())
475+
Output << "; did you mean '" << Closest << '\'';
476+
Output << VerifyConfigWarningEnd;
492477
}
493-
} else {
494-
if (AllChecks.contains(Cur))
495-
continue;
496-
AnyInvalid = true;
497-
llvm::raw_ostream &Output = llvm::WithColor::warning(llvm::errs(), Source)
498-
<< "unknown check '" << Cur << '\'';
499-
llvm::StringRef Closest = closest(Cur, AllChecks);
500-
if (!Closest.empty())
501-
Output << "; did you mean '" << Closest << '\'';
502-
Output << VerifyConfigWarningEnd;
503478
}
504479
}
505480
return AnyInvalid;

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "refactor/Rename.h"
3131
#include "refactor/Tweak.h"
3232
#include "support/Cancellation.h"
33+
#include "support/Context.h"
3334
#include "support/Logger.h"
3435
#include "support/MemoryTree.h"
3536
#include "support/ThreadsafeFS.h"
@@ -112,7 +113,12 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
112113
// Index outlives TUScheduler (declared first)
113114
FIndex(FIndex),
114115
// shared_ptr extends lifetime
115-
Stdlib(Stdlib)]() mutable {
116+
Stdlib(Stdlib),
117+
// We have some FS implementations that rely on information in
118+
// the context.
119+
Ctx(Context::current().clone())]() mutable {
120+
// Make sure we install the context into current thread.
121+
WithContext C(std::move(Ctx));
116122
clang::noteBottomOfStack();
117123
IndexFileIn IF;
118124
IF.Symbols = indexStandardLibrary(std::move(CI), Loc, *TFS);

clang-tools-extra/clangd/Preamble.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ buildPreamble(PathRef FileName, CompilerInvocation CI,
700700
Result->Marks = CapturedInfo.takeMarks();
701701
Result->StatCache = StatCache;
702702
Result->MainIsIncludeGuarded = CapturedInfo.isMainFileIncludeGuarded();
703+
Result->TargetOpts = CI.TargetOpts;
703704
if (PreambleCallback) {
704705
trace::Span Tracer("Running PreambleCallback");
705706
auto Ctx = CapturedInfo.takeLife();
@@ -913,6 +914,12 @@ PreamblePatch PreamblePatch::createMacroPatch(llvm::StringRef FileName,
913914
}
914915

915916
void PreamblePatch::apply(CompilerInvocation &CI) const {
917+
// Make sure the compilation uses same target opts as the preamble. Clang has
918+
// no guarantees around using arbitrary options when reusing PCHs, and
919+
// different target opts can result in crashes, see
920+
// ParsedASTTest.PreambleWithDifferentTarget.
921+
CI.TargetOpts = Baseline->TargetOpts;
922+
916923
// No need to map an empty file.
917924
if (PatchContents.empty())
918925
return;

0 commit comments

Comments
 (0)