Skip to content

Commit 7f6bbcc

Browse files
authored
Merge branch 'main' into x86-pmul-asm-constants
2 parents cc6f1a2 + f7e9968 commit 7f6bbcc

File tree

427 files changed

+11241
-2694
lines changed

Some content is hidden

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

427 files changed

+11241
-2694
lines changed

.ci/premerge_advisor_upload.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
failure_info = {
27+
"source_type": source,
28+
"base_commit_sha": commit_sha,
29+
"source_id": workflow_run_number,
30+
"failures": [],
31+
}
32+
if test_failures:
33+
for name, failure_message in test_failures:
34+
failure_info["failures"].append({"name": name, "message": failure_message})
35+
else:
36+
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
37+
for name, failure_message in ninja_failures:
38+
failure_info["failures"].append({"name": name, "message": failure_message})
39+
requests.post(PREMERGE_ADVISOR_URL, json=failure_info)
40+
41+
42+
if __name__ == "__main__":
43+
parser = argparse.ArgumentParser()
44+
parser.add_argument("commit_sha", help="The base commit SHA for the test.")
45+
parser.add_argument("workflow_run_number", help="The run number from GHA.")
46+
parser.add_argument(
47+
"build_log_files", help="Paths to JUnit report files and ninja logs.", nargs="*"
48+
)
49+
args = parser.parse_args()
50+
51+
# Skip uploading results on AArch64 for now because the premerge advisor
52+
# service is not available on AWS currently.
53+
if platform.machine() == "arm64":
54+
sys.exit(0)
55+
56+
main(args.commit_sha, args.workflow_run_number, args.build_log_files)

.ci/utils.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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/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)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ struct InitializerInsertion {
190190
// Convenience utility to get a RecordDecl from a QualType.
191191
const RecordDecl *getCanonicalRecordDecl(const QualType &Type) {
192192
if (const auto *RT = Type->getAsCanonical<RecordType>())
193-
return RT->getOriginalDecl();
193+
return RT->getDecl();
194194
return nullptr;
195195
}
196196

clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static bool isStdInitializerList(QualType Type) {
7272
}
7373
if (const auto *RT = Type->getAs<RecordType>()) {
7474
if (const auto *Specialization =
75-
dyn_cast<ClassTemplateSpecializationDecl>(RT->getOriginalDecl()))
75+
dyn_cast<ClassTemplateSpecializationDecl>(RT->getDecl()))
7676
return declIsStdInitializerList(Specialization->getSpecializedTemplate());
7777
}
7878
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
132132
}
133133
if (const auto *ECD = dyn_cast<EnumConstantDecl>(Used)) {
134134
if (const auto *ET = ECD->getType()->getAsCanonical<EnumType>())
135-
removeFromFoundDecls(ET->getOriginalDecl());
135+
removeFromFoundDecls(ET->getDecl());
136136
}
137137
};
138138
// We rely on the fact that the clang AST is walked in order, usages are only

clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static bool isLockGuardDecl(const NamedDecl *Decl) {
2929

3030
static bool isLockGuard(const QualType &Type) {
3131
if (const auto *Record = Type->getAsCanonical<RecordType>())
32-
if (const RecordDecl *Decl = Record->getOriginalDecl())
32+
if (const RecordDecl *Decl = Record->getDecl())
3333
return isLockGuardDecl(Decl);
3434

3535
if (const auto *TemplateSpecType = Type->getAs<TemplateSpecializationType>())

clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct UnqualNameVisitor : public RecursiveASTVisitor<UnqualNameVisitor> {
7777
if (T->getKeyword() != ElaboratedTypeKeyword::None ||
7878
TTL.getQualifierLoc())
7979
break;
80-
if (visitUnqualName(T->getOriginalDecl()->getName()))
80+
if (visitUnqualName(T->getDecl()->getName()))
8181
return false;
8282
break;
8383
}

0 commit comments

Comments
 (0)