Skip to content

Commit 8e92193

Browse files
committed
LLVM and SPIRV-LLVM-Translator pulldown (WW32)
LLVM: llvm/llvm-project@920c461 SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@bb2196b
2 parents 1ad69e5 + a26b643 commit 8e92193

File tree

15,114 files changed

+1057684
-436477
lines changed

Some content is hidden

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

15,114 files changed

+1057684
-436477
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
#===----------------------------------------------------------------------===##
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
#===----------------------------------------------------------------------===##
9+
10+
#
11+
# This file generates a Buildkite pipeline that triggers the various CI jobs for
12+
# the LLVM project during pre-commit CI (each time a Phabricator diff is uploaded).
13+
#
14+
# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
15+
#
16+
17+
if ! git diff --name-only HEAD~1 | grep -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/|^clang/"; then
18+
# libcxx/, libcxxabi/, libunwind/, runtimes/, cmake/ or clang/ are not affected
19+
exit 0
20+
fi
21+
22+
reviewID="$(git log --format=%B -n 1 | sed -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')"
23+
if [[ "${reviewID}" != "" ]]; then
24+
buildMessage="https://llvm.org/${reviewID}"
25+
else
26+
buildMessage="Push to branch ${BUILDKITE_BRANCH}"
27+
fi
28+
29+
cat <<EOF
30+
steps:
31+
EOF
32+
33+
# If libc++ or one of the runtimes directories changed
34+
if git diff --name-only HEAD~1 | grep -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/"; then
35+
cat <<EOF
36+
- trigger: "libcxx-ci"
37+
build:
38+
message: "${buildMessage}"
39+
commit: "${BUILDKITE_COMMIT}"
40+
branch: "${BUILDKITE_BRANCH}"
41+
EOF
42+
fi
43+
44+
# If clang changed
45+
if git diff --name-only HEAD~1 | grep -q -E "^clang/"; then
46+
cat <<EOF
47+
- trigger: "clang-ci"
48+
build:
49+
message: "${buildMessage}"
50+
commit: "${BUILDKITE_COMMIT}"
51+
branch: "${BUILDKITE_BRANCH}"
52+
EOF
53+
fi
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
#===----------------------------------------------------------------------===##
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
#===----------------------------------------------------------------------===##
9+
10+
#
11+
# This file generates a Buildkite pipeline that triggers the various CI jobs for
12+
# the LLVM project on scheduled builds.
13+
#
14+
# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
15+
#
16+
17+
cat <<EOF
18+
steps:
19+
- trigger: "libcxx-ci"
20+
build:
21+
message: "${BUILDKITE_MESSAGE}"
22+
commit: "${BUILDKITE_COMMIT}"
23+
branch: "${BUILDKITE_BRANCH}"
24+
25+
- trigger: "clang-ci"
26+
build:
27+
message: "${BUILDKITE_MESSAGE}"
28+
commit: "${BUILDKITE_COMMIT}"
29+
branch: "${BUILDKITE_BRANCH}"
30+
EOF

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@ f9008e6366c2496b1ca1785b891d5578174ad63e
5858

5959
# [libc++][NFC] Apply clang-format on large parts of the code base
6060
5aa03b648b827128d439f705cd7d57d59673741d
61+
62+
# [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs
63+
f6d557ee34b6bbdb1dc32f29e34b4a4a8ad35e81
64+
65+
# [libc++][NFC] clang-format <shared_mutex>
66+
2d7eb9c9ea1a146412a83603d5c0c6339a5d8284

.github/workflows/closed-issues.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Labeling closed issues
22
on:
3-
issues:
4-
types: ['closed']
3+
workflow_dispatch
4+
# issues:
5+
# types: ['closed']
56

67
permissions:
78
contents: read

.github/workflows/release-tasks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
uses: actions/checkout@v3
8585

8686
- name: Install dependencies
87-
run: apt-get install -y python3-setuptools
87+
run: sudo apt-get install -y python3-setuptools
8888

8989
- name: Test lit
9090
run: |

.github/workflows/repo-lockdown.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ on:
77
- 'libcxxabi/**'
88
- 'libunwind/**'
99
- 'runtimes/**'
10+
- 'lldb/**'
11+
- '.github/**'
12+
- 'clang/lib/Format/**'
13+
- 'clang/include/clang/Format/**'
14+
- 'clang/docs/**'
15+
- 'clang/unitests/Format/**'
16+
- 'clang/tools/clang-format/**'
1017

1118
permissions:
1219
pull-requests: write

bolt/include/bolt/Core/BinaryBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class BinaryBasicBlock {
103103
/// After output/codegen, map output offsets of instructions in this basic
104104
/// block to instruction offsets in the original function. Note that the
105105
/// output basic block could be different from the input basic block.
106-
/// We only map instruction of interest, such as calls, and sdt markers.
106+
/// We only map instruction of interest, such as calls and markers.
107107
///
108108
/// We store the offset array in a basic block to facilitate BAT tables
109109
/// generation. Otherwise, the mapping could be done at function level.

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "llvm/MC/MCContext.h"
3030
#include "llvm/MC/MCObjectFileInfo.h"
3131
#include "llvm/MC/MCObjectWriter.h"
32-
#include "llvm/MC/MCPseudoProbe.h"
3332
#include "llvm/MC/MCSectionELF.h"
3433
#include "llvm/MC/MCSectionMachO.h"
3534
#include "llvm/MC/MCStreamer.h"
@@ -639,9 +638,22 @@ class BinaryContext {
639638
/// Total hotness score according to profiling data for this binary.
640639
uint64_t TotalScore{0};
641640

642-
/// Binary-wide stats for macro-fusion.
643-
uint64_t MissedMacroFusionPairs{0};
644-
uint64_t MissedMacroFusionExecCount{0};
641+
/// Binary-wide aggregated stats.
642+
struct BinaryStats {
643+
/// Stats for macro-fusion.
644+
uint64_t MissedMacroFusionPairs{0};
645+
uint64_t MissedMacroFusionExecCount{0};
646+
647+
/// Stats for stale profile matching:
648+
/// the total number of basic blocks in the profile
649+
uint32_t NumStaleBlocks{0};
650+
/// the number of matched basic blocks
651+
uint32_t NumMatchedBlocks{0};
652+
/// the total count of samples in the profile
653+
uint64_t StaleSampleCount{0};
654+
/// the count of matched samples
655+
uint64_t MatchedSampleCount{0};
656+
} Stats;
645657

646658
// Address of the first allocated segment.
647659
uint64_t FirstAllocAddress{std::numeric_limits<uint64_t>::max()};
@@ -673,20 +685,10 @@ class BinaryContext {
673685
/// List of functions that always trap.
674686
std::vector<const BinaryFunction *> TrappedFunctions;
675687

676-
/// Map SDT locations to SDT markers info
677-
std::unordered_map<uint64_t, SDTMarkerInfo> SDTMarkers;
678-
679-
/// Map linux kernel program locations/instructions to their pointers in
680-
/// special linux kernel sections
681-
std::unordered_map<uint64_t, std::vector<LKInstructionMarkerInfo>> LKMarkers;
682-
683688
/// List of external addresses in the code that are not a function start
684689
/// and are referenced from BinaryFunction.
685690
std::list<std::pair<BinaryFunction *, uint64_t>> InterproceduralReferences;
686691

687-
/// PseudoProbe decoder
688-
MCPseudoProbeDecoder ProbeDecoder;
689-
690692
/// DWARF encoding. Available encoding types defined in BinaryFormat/Dwarf.h
691693
/// enum Constants, e.g. DW_EH_PE_omit.
692694
unsigned LSDAEncoding = dwarf::DW_EH_PE_omit;

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ class BinaryFunction {
339339
bool HasPseudoProbe{BC.getUniqueSectionByName(".pseudo_probe_desc") &&
340340
BC.getUniqueSectionByName(".pseudo_probe")};
341341

342+
/// True if the function uses ORC format for stack unwinding.
343+
bool HasORC{false};
344+
342345
/// True if the original entry point was patched.
343346
bool IsPatched{false};
344347

@@ -378,7 +381,7 @@ class BinaryFunction {
378381
/// Profile match ratio.
379382
float ProfileMatchRatio{0.0f};
380383

381-
/// Raw branch count for this function in the profile
384+
/// Raw branch count for this function in the profile.
382385
uint64_t RawBranchCount{0};
383386

384387
/// Indicates the type of profile the function is using.
@@ -423,21 +426,6 @@ class BinaryFunction {
423426
return BB->getIndex();
424427
}
425428

426-
/// Return basic block that originally contained offset \p Offset
427-
/// from the function start.
428-
BinaryBasicBlock *getBasicBlockContainingOffset(uint64_t Offset);
429-
430-
const BinaryBasicBlock *getBasicBlockContainingOffset(uint64_t Offset) const {
431-
return const_cast<BinaryFunction *>(this)->getBasicBlockContainingOffset(
432-
Offset);
433-
}
434-
435-
/// Return basic block that started at offset \p Offset.
436-
BinaryBasicBlock *getBasicBlockAtOffset(uint64_t Offset) {
437-
BinaryBasicBlock *BB = getBasicBlockContainingOffset(Offset);
438-
return BB && BB->getOffset() == Offset ? BB : nullptr;
439-
}
440-
441429
/// Release memory taken by the list.
442430
template <typename T> BinaryFunction &clearList(T &List) {
443431
T TempList;
@@ -619,10 +607,6 @@ class BinaryFunction {
619607
Islands->CodeOffsets.emplace(Offset);
620608
}
621609

622-
/// Register secondary entry point at a given \p Offset into the function.
623-
/// Return global symbol for use by extern function references.
624-
MCSymbol *addEntryPointAtOffset(uint64_t Offset);
625-
626610
/// Register an internal offset in a function referenced from outside.
627611
void registerReferencedOffset(uint64_t Offset) {
628612
ExternallyReferencedOffsets.emplace(Offset);
@@ -900,6 +884,21 @@ class BinaryFunction {
900884
return LabelToBB.lookup(Label);
901885
}
902886

887+
/// Return basic block that originally contained offset \p Offset
888+
/// from the function start.
889+
BinaryBasicBlock *getBasicBlockContainingOffset(uint64_t Offset);
890+
891+
const BinaryBasicBlock *getBasicBlockContainingOffset(uint64_t Offset) const {
892+
return const_cast<BinaryFunction *>(this)->getBasicBlockContainingOffset(
893+
Offset);
894+
}
895+
896+
/// Return basic block that started at offset \p Offset.
897+
BinaryBasicBlock *getBasicBlockAtOffset(uint64_t Offset) {
898+
BinaryBasicBlock *BB = getBasicBlockContainingOffset(Offset);
899+
return BB && BB->getOffset() == Offset ? BB : nullptr;
900+
}
901+
903902
/// Retrieve the landing pad BB associated with invoke instruction \p Invoke
904903
/// that is in \p BB. Return nullptr if none exists
905904
BinaryBasicBlock *getLandingPadBBFor(const BinaryBasicBlock &BB,
@@ -1344,6 +1343,9 @@ class BinaryFunction {
13441343
/// Return true if the function has Pseudo Probe
13451344
bool hasPseudoProbe() const { return HasPseudoProbe; }
13461345

1346+
/// Return true if the function uses ORC format for stack unwinding.
1347+
bool hasORC() const { return HasORC; }
1348+
13471349
/// Return true if the original entry point was patched.
13481350
bool isPatched() const { return IsPatched; }
13491351

@@ -1445,6 +1447,10 @@ class BinaryFunction {
14451447
/// symbol associated with the entry.
14461448
MCSymbol *addEntryPoint(const BinaryBasicBlock &BB);
14471449

1450+
/// Register secondary entry point at a given \p Offset into the function.
1451+
/// Return global symbol for use by extern function references.
1452+
MCSymbol *addEntryPointAtOffset(uint64_t Offset);
1453+
14481454
/// Mark all blocks that are unreachable from a root (entry point
14491455
/// or landing pad) as invalid.
14501456
void markUnreachableBlocks();
@@ -1702,6 +1708,11 @@ class BinaryFunction {
17021708
/// Indicate that another function body was merged with this function.
17031709
void setHasFunctionsFoldedInto() { HasFunctionsFoldedInto = true; }
17041710

1711+
void setHasSDTMarker(bool V) { HasSDTMarker = V; }
1712+
1713+
/// Mark the function as using ORC format for stack unwinding.
1714+
void setHasORC(bool V) { HasORC = V; }
1715+
17051716
BinaryFunction &setPersonalityFunction(uint64_t Addr) {
17061717
assert(!PersonalityFunction && "can't set personality function twice");
17071718
PersonalityFunction = BC.getOrCreateGlobalSymbol(Addr, "FUNCat");

bolt/include/bolt/Core/BinarySection.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -509,27 +509,6 @@ inline raw_ostream &operator<<(raw_ostream &OS, const BinarySection &Section) {
509509
return OS;
510510
}
511511

512-
struct SDTMarkerInfo {
513-
uint64_t PC;
514-
uint64_t Base;
515-
uint64_t Semaphore;
516-
StringRef Provider;
517-
StringRef Name;
518-
StringRef Args;
519-
520-
/// The offset of PC within the note section
521-
unsigned PCOffset;
522-
};
523-
524-
/// Linux Kernel special sections point to a specific instruction in many cases.
525-
/// Unlike SDTMarkerInfo, these markers can come from different sections.
526-
struct LKInstructionMarkerInfo {
527-
uint64_t SectionOffset;
528-
int32_t PCRelativeOffset;
529-
bool IsPCRelative;
530-
StringRef SectionName;
531-
};
532-
533512
} // namespace bolt
534513
} // namespace llvm
535514

0 commit comments

Comments
 (0)