Skip to content

Commit 456e217

Browse files
authored
Merge branch 'main' into x86-movemask-constexpr
2 parents 1facbe8 + 05e8600 commit 456e217

File tree

722 files changed

+21462
-6249
lines changed

Some content is hidden

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

722 files changed

+21462
-6249
lines changed

.ci/monolithic-linux.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ start-group "ninja"
6666

6767
# Targets are not escaped as they are passed as separate arguments.
6868
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
69+
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
6970

7071
if [[ "${runtime_targets}" != "" ]]; then
7172
start-group "ninja Runtimes"
7273

7374
ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
75+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
7476
fi
7577

7678
# Compiling runtimes with just-built Clang and running their tests
@@ -87,6 +89,7 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
8789

8890
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
8991
|& tee ninja_runtimes_needs_reconfig1.log
92+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconig.ninja_log
9093

9194
start-group "CMake Runtimes Clang Modules"
9295

@@ -99,4 +102,5 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
99102

100103
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
101104
|& tee ninja_runtimes_needs_reconfig2.log
105+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconfig2.ninja_log
102106
fi

.ci/monolithic-windows.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ start-group "ninja"
5555

5656
# Targets are not escaped as they are passed as separate arguments.
5757
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
58+
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
5859

5960
if [[ "${runtime_targets}" != "" ]]; then
6061
start-group "ninja runtimes"
6162

6263
ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
64+
cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
6365
fi

.ci/premerge_advisor_upload.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
"""Script for uploading results to the premerge advisor."""
5+
6+
import argparse
7+
import os
8+
import platform
9+
import sys
10+
11+
import requests
12+
13+
import generate_test_report_lib
14+
15+
PREMERGE_ADVISOR_URL = (
16+
"http://premerge-advisor.premerge-advisor.svc.cluster.local:5000/upload"
17+
)
18+
19+
20+
def main(commit_sha, workflow_run_number, build_log_files):
21+
junit_objects, ninja_logs = generate_test_report_lib.load_info_from_files(
22+
build_log_files
23+
)
24+
test_failures = generate_test_report_lib.get_failures(junit_objects)
25+
source = "pull_request" if "GITHUB_ACTIONS" in os.environ else "postcommit"
26+
current_platform = f"{platform.system()}-{platform.machine()}".lower()
27+
failure_info = {
28+
"source_type": source,
29+
"base_commit_sha": commit_sha,
30+
"source_id": workflow_run_number,
31+
"failures": [],
32+
"platform": current_platform,
33+
}
34+
if test_failures:
35+
for name, failure_message in test_failures:
36+
failure_info["failures"].append({"name": name, "message": failure_message})
37+
else:
38+
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
39+
for name, failure_message in ninja_failures:
40+
failure_info["failures"].append({"name": name, "message": failure_message})
41+
requests.post(PREMERGE_ADVISOR_URL, json=failure_info)
42+
43+
44+
if __name__ == "__main__":
45+
parser = argparse.ArgumentParser()
46+
parser.add_argument("commit_sha", help="The base commit SHA for the test.")
47+
parser.add_argument("workflow_run_number", help="The run number from GHA.")
48+
parser.add_argument(
49+
"build_log_files", help="Paths to JUnit report files and ninja logs.", nargs="*"
50+
)
51+
args = parser.parse_args()
52+
53+
# Skip uploading results on AArch64 for now because the premerge advisor
54+
# service is not available on AWS currently.
55+
if platform.machine() == "arm64":
56+
sys.exit(0)
57+
58+
main(args.commit_sha, args.workflow_run_number, args.build_log_files)

.ci/utils.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function at-exit {
2626
mkdir -p artifacts
2727
sccache --show-stats
2828
sccache --show-stats >> artifacts/sccache_stats.txt
29-
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
29+
cp "${MONOREPO_ROOT}"/*.ninja_log artifacts/ || :
3030
cp "${MONOREPO_ROOT}"/*.log artifacts/ || :
3131
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
3232

@@ -38,6 +38,12 @@ function at-exit {
3838
$retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
3939
>> $GITHUB_STEP_SUMMARY
4040
fi
41+
42+
if [[ "$retcode" != "0" ]]; then
43+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
44+
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
45+
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
46+
fi
4147
}
4248
trap at-exit EXIT
4349

bolt/lib/Core/CallGraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#undef USE_SSECRC
2323
#endif
2424

25-
static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64_fallback(int64_t k) {
25+
[[maybe_unused]] static inline size_t hash_int64_fallback(int64_t k) {
2626
uint64_t key = (unsigned long long)k;
2727
// "64 bit Mix Functions", from Thomas Wang's "Integer Hash Function."
2828
// http://www.concentric.net/~ttwang/tech/inthash.htm
@@ -35,7 +35,7 @@ static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64_fallback(int64_t k) {
3535
return static_cast<size_t>(static_cast<uint32_t>(key));
3636
}
3737

38-
static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64(int64_t k) {
38+
[[maybe_unused]] static inline size_t hash_int64(int64_t k) {
3939
#if defined(USE_SSECRC) && defined(__SSE4_2__)
4040
size_t h = 0;
4141
__asm("crc32q %1, %0\n" : "+r"(h) : "rm"(k));

bolt/lib/Core/DebugData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ std::optional<AttrInfo> findAttributeInfo(const DWARFDie DIE,
101101
return findAttributeInfo(DIE, AbbrevDecl, *Index);
102102
}
103103

104-
LLVM_ATTRIBUTE_UNUSED
104+
[[maybe_unused]]
105105
static void printLE64(const std::string &S) {
106106
for (uint32_t I = 0, Size = S.size(); I < Size; ++I) {
107107
errs() << Twine::utohexstr(S[I]);

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void printDie(const DWARFDie &DIE) {
6969
}
7070

7171
/// Lazily parse DWARF DIE and print it out.
72-
LLVM_ATTRIBUTE_UNUSED
72+
[[maybe_unused]]
7373
static void printDie(DWARFUnit &DU, uint64_t DIEOffset) {
7474
uint64_t OriginalOffsets = DIEOffset;
7575
uint64_t NextCUOffset = DU.getNextUnitOffset();

bolt/unittests/Core/MCPlusBuilder.cpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,82 @@ TEST_P(MCPlusBuilderTester, testAccessedRegsMultipleDefs) {
261261
{AArch64::W5, AArch64::X5, AArch64::W5_HI});
262262
}
263263

264+
TEST_P(MCPlusBuilderTester, AArch64_Psign_Pauth_variants) {
265+
if (GetParam() != Triple::aarch64)
266+
GTEST_SKIP();
267+
268+
MCInst Paciasp = MCInstBuilder(AArch64::PACIASP);
269+
MCInst Pacibsp = MCInstBuilder(AArch64::PACIBSP);
270+
ASSERT_TRUE(BC->MIB->isPSignOnLR(Paciasp));
271+
ASSERT_TRUE(BC->MIB->isPSignOnLR(Pacibsp));
272+
273+
MCInst PaciaSPLR =
274+
MCInstBuilder(AArch64::PACIA).addReg(AArch64::LR).addReg(AArch64::SP);
275+
MCInst PacibSPLR =
276+
MCInstBuilder(AArch64::PACIB).addReg(AArch64::LR).addReg(AArch64::SP);
277+
ASSERT_TRUE(BC->MIB->isPSignOnLR(PaciaSPLR));
278+
ASSERT_TRUE(BC->MIB->isPSignOnLR(PacibSPLR));
279+
280+
MCInst PacizaX5 = MCInstBuilder(AArch64::PACIZA).addReg(AArch64::X5);
281+
MCInst PacizbX5 = MCInstBuilder(AArch64::PACIZB).addReg(AArch64::X5);
282+
ASSERT_FALSE(BC->MIB->isPSignOnLR(PacizaX5));
283+
ASSERT_FALSE(BC->MIB->isPSignOnLR(PacizbX5));
284+
285+
MCInst Paciaz = MCInstBuilder(AArch64::PACIZA).addReg(AArch64::LR);
286+
MCInst Pacibz = MCInstBuilder(AArch64::PACIZB).addReg(AArch64::LR);
287+
ASSERT_TRUE(BC->MIB->isPSignOnLR(Paciaz));
288+
ASSERT_TRUE(BC->MIB->isPSignOnLR(Pacibz));
289+
290+
MCInst Pacia1716 = MCInstBuilder(AArch64::PACIA1716);
291+
MCInst Pacib1716 = MCInstBuilder(AArch64::PACIB1716);
292+
ASSERT_FALSE(BC->MIB->isPSignOnLR(Pacia1716));
293+
ASSERT_FALSE(BC->MIB->isPSignOnLR(Pacib1716));
294+
295+
MCInst Pacia171615 = MCInstBuilder(AArch64::PACIA171615);
296+
MCInst Pacib171615 = MCInstBuilder(AArch64::PACIB171615);
297+
ASSERT_FALSE(BC->MIB->isPSignOnLR(Pacia171615));
298+
ASSERT_FALSE(BC->MIB->isPSignOnLR(Pacib171615));
299+
300+
MCInst Autiasp = MCInstBuilder(AArch64::AUTIASP);
301+
MCInst Autibsp = MCInstBuilder(AArch64::AUTIBSP);
302+
ASSERT_TRUE(BC->MIB->isPAuthOnLR(Autiasp));
303+
ASSERT_TRUE(BC->MIB->isPAuthOnLR(Autibsp));
304+
305+
MCInst AutiaSPLR =
306+
MCInstBuilder(AArch64::AUTIA).addReg(AArch64::LR).addReg(AArch64::SP);
307+
MCInst AutibSPLR =
308+
MCInstBuilder(AArch64::AUTIB).addReg(AArch64::LR).addReg(AArch64::SP);
309+
ASSERT_TRUE(BC->MIB->isPAuthOnLR(AutiaSPLR));
310+
ASSERT_TRUE(BC->MIB->isPAuthOnLR(AutibSPLR));
311+
312+
MCInst AutizaX5 = MCInstBuilder(AArch64::AUTIZA).addReg(AArch64::X5);
313+
MCInst AutizbX5 = MCInstBuilder(AArch64::AUTIZB).addReg(AArch64::X5);
314+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(AutizaX5));
315+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(AutizbX5));
316+
317+
MCInst Autiaz = MCInstBuilder(AArch64::AUTIZA).addReg(AArch64::LR);
318+
MCInst Autibz = MCInstBuilder(AArch64::AUTIZB).addReg(AArch64::LR);
319+
ASSERT_TRUE(BC->MIB->isPAuthOnLR(Autiaz));
320+
ASSERT_TRUE(BC->MIB->isPAuthOnLR(Autibz));
321+
322+
MCInst Autia1716 = MCInstBuilder(AArch64::AUTIA1716);
323+
MCInst Autib1716 = MCInstBuilder(AArch64::AUTIB1716);
324+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(Autia1716));
325+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(Autib1716));
326+
327+
MCInst Autia171615 = MCInstBuilder(AArch64::AUTIA171615);
328+
MCInst Autib171615 = MCInstBuilder(AArch64::AUTIB171615);
329+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(Autia171615));
330+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(Autib171615));
331+
332+
MCInst Retaa = MCInstBuilder(AArch64::RETAA);
333+
MCInst Retab = MCInstBuilder(AArch64::RETAB);
334+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(Retaa));
335+
ASSERT_FALSE(BC->MIB->isPAuthOnLR(Retab));
336+
ASSERT_TRUE(BC->MIB->isPAuthAndRet(Retaa));
337+
ASSERT_TRUE(BC->MIB->isPAuthAndRet(Retab));
338+
}
339+
264340
#endif // AARCH64_AVAILABLE
265341

266342
#ifdef X86_AVAILABLE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
BasedOnStyle: LLVM
22
QualifierAlignment: Left
3+
LineEnding: LF

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ class FindEnumMember : public TypeVisitor<FindEnumMember, bool> {
6969
return Visit(T->getElementType().getTypePtr());
7070
}
7171
bool VisitEnumType(const EnumType *T) {
72-
if (isCompleteAndHasNoZeroValue(T->getOriginalDecl())) {
72+
if (isCompleteAndHasNoZeroValue(T->getDecl())) {
7373
FoundEnum = T;
7474
return true;
7575
}
7676
return false;
7777
}
7878
bool VisitRecordType(const RecordType *T) {
79-
const RecordDecl *RD = T->getOriginalDecl()->getDefinition();
79+
const RecordDecl *RD = T->getDecl()->getDefinition();
8080
if (!RD || RD->isUnion())
8181
return false;
8282
auto VisitField = [this](const FieldDecl *F) {
@@ -139,7 +139,7 @@ void InvalidEnumDefaultInitializationCheck::check(
139139
if (!Finder.Visit(InitList->getArrayFiller()->getType().getTypePtr()))
140140
return;
141141
InitExpr = InitList;
142-
Enum = Finder.FoundEnum->getOriginalDecl();
142+
Enum = Finder.FoundEnum->getDecl();
143143
}
144144

145145
if (!InitExpr || !Enum)

0 commit comments

Comments
 (0)