Skip to content

Commit caaad39

Browse files
committed
LLVM and SPIRV-LLVM-Translator pulldown (WW48)
LLVM: llvm/llvm-project@225648e SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@3770469
2 parents ea6a3a3 + 522cefd commit caaad39

File tree

2,749 files changed

+112029
-79792
lines changed

Some content is hidden

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

2,749 files changed

+112029
-79792
lines changed

.ci/monolithic-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4949
-D LLVM_ENABLE_LLD=ON \
5050
-D CMAKE_CXX_FLAGS=-gmlt \
5151
-D BOLT_CLANG_EXE=/usr/bin/clang \
52-
-D LLVM_CCACHE_BUILD=ON
52+
-D LLVM_CCACHE_BUILD=ON \
53+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5354

5455
echo "--- ninja"
5556
# Targets are not escaped as they are passed as separate arguments.

.ci/monolithic-windows.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4848
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml" \
4949
-D COMPILER_RT_BUILD_ORC=OFF \
5050
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
51-
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache
51+
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
52+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5253

5354
echo "--- ninja"
5455
# Targets are not escaped as they are passed as separate arguments.

.github/workflows/docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
paths:
1616
- 'llvm/docs/**'
1717
- 'clang/docs/**'
18+
- 'clang/include/clang/Basic/AttrDocs.td'
19+
- 'clang/include/clang/Driver/ClangOptionDocs.td'
20+
- 'clang/include/clang/Basic/DiagnosticDocs.td'
1821
- 'clang-tools-extra/docs/**'
1922
- 'lldb/docs/**'
2023
- 'libunwind/docs/**'
@@ -29,6 +32,9 @@ on:
2932
paths:
3033
- 'llvm/docs/**'
3134
- 'clang/docs/**'
35+
- 'clang/include/clang/Basic/AttrDocs.td'
36+
- 'clang/include/clang/Driver/ClangOptionDocs.td'
37+
- 'clang/include/clang/Basic/DiagnosticDocs.td'
3238
- 'clang-tools-extra/docs/**'
3339
- 'lldb/docs/**'
3440
- 'libunwind/docs/**'
@@ -64,6 +70,9 @@ jobs:
6470
- 'llvm/docs/**'
6571
clang:
6672
- 'clang/docs/**'
73+
- 'clang/include/clang/Basic/AttrDocs.td'
74+
- 'clang/include/clang/Driver/ClangOptionDocs.td'
75+
- 'clang/include/clang/Basic/DiagnosticDocs.td'
6776
clang-tools-extra:
6877
- 'clang-tools-extra/docs/**'
6978
lldb:

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ on:
2222
- 'runtimes/**'
2323
- 'cmake/**'
2424
- '.github/workflows/libcxx-build-and-test.yaml'
25+
schedule:
26+
# Run nightly at 8 AM UTC (or roughly 3 AM eastern)
27+
- cron: '0 3 * * *'
28+
29+
permissions:
30+
contents: read # Default everything to read-only
2531

2632
concurrency:
2733
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
@@ -157,7 +163,11 @@ jobs:
157163
'generic-no-unicode',
158164
'generic-no-wide-characters',
159165
'generic-static',
160-
'generic-with_llvm_unwinder'
166+
'generic-with_llvm_unwinder',
167+
# TODO Find a better place for the benchmark and bootstrapping builds to live. They're either very expensive
168+
# or don't provide much value since the benchmark run results are too noise on the bots.
169+
'benchmarks',
170+
'bootstrapping-build'
161171
]
162172
machine: [ 'libcxx-runners-8' ]
163173
std_modules: [ 'OFF' ]

.github/workflows/pr-code-format.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ jobs:
4040
path: code-format-tools
4141

4242
- name: "Listed files"
43+
env:
44+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
4345
run: |
4446
echo "Formatting files:"
45-
echo "${{ steps.changed-files.outputs.all_changed_files }}"
47+
echo "$CHANGED_FILES"
4648
4749
- name: Install clang-format
4850
uses: aminya/setup-cpp@v1

.github/workflows/sync-release-repo.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,9 @@ class BinaryContext {
611611
/// Indicates if the binary contains split functions.
612612
bool HasSplitFunctions{false};
613613

614+
/// Indicates if the function ordering of the binary is finalized.
615+
bool HasFinalizedFunctionOrder{false};
616+
614617
/// Is the binary always loaded at a fixed address. Shared objects and
615618
/// position-independent executables (PIEs) are examples of binaries that
616619
/// will have HasFixedLoadAddress set to false.
@@ -1230,6 +1233,9 @@ class BinaryContext {
12301233
///
12311234
/// Return the pair where the first size is for the main part, and the second
12321235
/// size is for the cold one.
1236+
/// Modify BinaryBasicBlock::OutputAddressRange for each basic block in the
1237+
/// function in place so that BinaryBasicBlock::getOutputSize() gives the
1238+
/// emitted size of the basic block.
12331239
std::pair<size_t, size_t> calculateEmittedSize(BinaryFunction &BF,
12341240
bool FixBranches = true);
12351241

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ class DIEBuilder {
273273
void buildCompileUnits(const std::vector<DWARFUnit *> &CUs);
274274
/// Preventing implicit conversions.
275275
template <class T> void buildCompileUnits(T) = delete;
276-
void buildBoth();
276+
/// Builds DWO Unit. For DWARF5 this includes the type units.
277+
void buildDWOUnit(DWARFUnit &U);
277278

278279
/// Returns DWARFUnitInfo for DWARFUnit
279280
DWARFUnitInfo &getUnitInfoByDwarfUnit(const DWARFUnit &DwarfUnit) {

bolt/include/bolt/Passes/SplitFunctions.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ enum SplitFunctionsStrategy : char {
2323
/// Split each function into a hot and cold fragment using profiling
2424
/// information.
2525
Profile2 = 0,
26+
/// Split each function into a hot, warm, and cold fragment using
27+
/// profiling information.
28+
CDSplit,
2629
/// Split each function into a hot and cold fragment at a randomly chosen
2730
/// split point (ignoring any available profiling information).
2831
Random2,
@@ -40,7 +43,7 @@ class SplitStrategy {
4043

4144
virtual ~SplitStrategy() = default;
4245
virtual bool canSplit(const BinaryFunction &BF) = 0;
43-
virtual bool keepEmpty() = 0;
46+
virtual bool compactFragments() = 0;
4447
virtual void fragment(const BlockIt Start, const BlockIt End) = 0;
4548
};
4649

bolt/lib/Core/BinaryContext.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,14 +2331,36 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
23312331
MCAsmLayout Layout(Assembler);
23322332
Assembler.layout(Layout);
23332333

2334+
// Obtain fragment sizes.
2335+
std::vector<uint64_t> FragmentSizes;
2336+
// Main fragment size.
23342337
const uint64_t HotSize =
23352338
Layout.getSymbolOffset(*EndLabel) - Layout.getSymbolOffset(*StartLabel);
2336-
const uint64_t ColdSize =
2337-
std::accumulate(SplitLabels.begin(), SplitLabels.end(), 0ULL,
2338-
[&](const uint64_t Accu, const LabelRange &Labels) {
2339-
return Accu + Layout.getSymbolOffset(*Labels.second) -
2340-
Layout.getSymbolOffset(*Labels.first);
2341-
});
2339+
FragmentSizes.push_back(HotSize);
2340+
// Split fragment sizes.
2341+
uint64_t ColdSize = 0;
2342+
for (const auto &Labels : SplitLabels) {
2343+
uint64_t Size = Layout.getSymbolOffset(*Labels.second) -
2344+
Layout.getSymbolOffset(*Labels.first);
2345+
FragmentSizes.push_back(Size);
2346+
ColdSize += Size;
2347+
}
2348+
2349+
// Populate new start and end offsets of each basic block.
2350+
uint64_t FragmentIndex = 0;
2351+
for (FunctionFragment &FF : BF.getLayout().fragments()) {
2352+
BinaryBasicBlock *PrevBB = nullptr;
2353+
for (BinaryBasicBlock *BB : FF) {
2354+
const uint64_t BBStartOffset = Layout.getSymbolOffset(*(BB->getLabel()));
2355+
BB->setOutputStartAddress(BBStartOffset);
2356+
if (PrevBB)
2357+
PrevBB->setOutputEndAddress(BBStartOffset);
2358+
PrevBB = BB;
2359+
}
2360+
if (PrevBB)
2361+
PrevBB->setOutputEndAddress(FragmentSizes[FragmentIndex]);
2362+
FragmentIndex++;
2363+
}
23422364

23432365
// Clean-up the effect of the code emission.
23442366
for (const MCSymbol &Symbol : Assembler.symbols()) {

0 commit comments

Comments
 (0)