Skip to content

Commit b081ce6

Browse files
authored
Merge branch 'main' into users/kparzysz/spr/t08-versioned-spellings
2 parents fda5ad0 + 4dcc159 commit b081ce6

File tree

4,065 files changed

+243932
-141443
lines changed

Some content is hidden

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

4,065 files changed

+243932
-141443
lines changed

.ci/metrics/metrics.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -349,19 +349,7 @@ def github_get_metrics(
349349
running_count[metric_name] += 1
350350
continue
351351

352-
job_result = int(job.conclusion == "success")
353-
if job_result:
354-
# We still might want to mark the job as a failure if one of the steps
355-
# failed. This is required due to use setting continue-on-error in
356-
# the premerge pipeline to prevent sending emails while we are
357-
# testing the infrastructure.
358-
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
359-
# longer in a testing state and we can directly assert the workflow
360-
# result.
361-
for step in job.steps:
362-
if step.conclusion != "success" and step.conclusion != "skipped":
363-
job_result = 0
364-
break
352+
job_result = int(job.conclusion == "success" or job.conclusion == "skipped")
365353

366354
created_at = job.created_at
367355
started_at = job.started_at

.ci/monolithic-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function at-exit {
3838

3939
ccache --print-stats > artifacts/ccache_stats.txt
4040
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
41+
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
4142

4243
# If building fails there will be no results files.
4344
shopt -s nullglob
@@ -46,7 +47,7 @@ function at-exit {
4647
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_buildkite.py ":linux: Linux x64 Test Results" \
4748
"linux-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
4849
else
49-
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":linux: Linux x64 Test Results" \
50+
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
5051
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
5152
fi
5253
}

.ci/monolithic-windows.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function at-exit {
3333
mkdir -p artifacts
3434
sccache --show-stats >> artifacts/sccache_stats.txt
3535
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
36+
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
3637

3738
# If building fails there will be no results files.
3839
shopt -s nullglob
@@ -41,7 +42,7 @@ function at-exit {
4142
python "${MONOREPO_ROOT}"/.ci/generate_test_report_buildkite.py ":windows: Windows x64 Test Results" \
4243
"windows-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
4344
else
44-
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":windows: Windows x64 Test Results" \
45+
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
4546
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
4647
fi
4748
}

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
/mlir/**/Transforms/SROA.* @moxinilian
129129

130130
# BOLT
131-
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9
131+
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis
132132

133133
# Bazel build system.
134134
/utils/bazel/ @rupprecht @keith @aaronmondal

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,12 @@ flang:fir-hlfir:
554554
flang:codegen:
555555
- flang/**/CodeGen/**
556556

557+
llvm:codegen:
558+
- llvm/lib/CodeGen/*
559+
- llvm/lib/CodeGen/MIRParser/*
560+
- llvm/lib/CodeGen/LiveDebugValues/*
561+
- llvm/lib/CodeGen/AsmPrinter/*
562+
557563
llvm:globalisel:
558564
- llvm/**/GlobalISel/**
559565
- llvm/utils/TableGen/GlobalISel*

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ RUN powershell -Command \
8585
RUN git config --system core.longpaths true & \
8686
git config --global core.autocrlf false
8787
88-
ARG RUNNER_VERSION=2.324.0
88+
ARG RUNNER_VERSION=2.325.0
8989
ENV RUNNER_VERSION=$RUNNER_VERSION
9090
9191
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ WORKDIR /home/gha
8686

8787
FROM ci-container as ci-container-agent
8888

89-
ENV GITHUB_RUNNER_VERSION=2.324.0
89+
ENV GITHUB_RUNNER_VERSION=2.325.0
9090

9191
RUN mkdir actions-runner && \
9292
cd actions-runner && \

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
206206
run: |
207207
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON ./llvm
208-
TZ=UTC ninja -C flang-build docs-flang-html
208+
TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man
209209
mkdir built-docs/flang
210210
cp -r flang-build/docs/* built-docs/flang/
211211
- name: Upload docs

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
**/crash_diagnostics/*
185185
186186
macos:
187-
needs: [ stage3 ]
187+
needs: [ stage2 ]
188188
strategy:
189189
fail-fast: false
190190
matrix:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install clang-format
5656
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
5757
with:
58-
clangformat: 19.1.6
58+
clangformat: 20.1.5
5959

6060
- name: Setup Python env
6161
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0

bolt/Maintainers.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ N: Vladislav Khmelevsky
2020
2121
D: AArch64 backend
2222

23+
N: Paschalis Mpeis
24+
25+
D: AArch64 backend
26+
2327
N: Job Noorman
2428
2529
D: RISC-V backend

bolt/docs/Heatmaps.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ For the generation, the default bucket size was used with a line size of 128.
8989
Some useful options are:
9090

9191
```
92-
-line-size=<uint> - number of entries per line (default 256)
92+
-line-size=<uint> - number of entries per line (default 256).
93+
Use a smaller value (e.g. 128) if the heatmap doesn't fit
94+
the screen horizontally.
95+
-block-size=<initial size>[,<zoom-out size>,...] - heatmap bucket size,
96+
optionally followed by zoom-out sizes to produce coarse-
97+
grained heatmaps. Size can be specified in human-readable
98+
format with [kKmMgG][i][B] suffix. Default 64B, 4K, 256K.
9399
-max-address=<uint> - maximum address considered valid for heatmap (default 4GB)
94100
-print-mappings - print mappings in the legend, between characters/blocks and text sections (default false)
95101
```

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,7 @@ class BinaryFunction {
23482348
releaseCFG();
23492349
CurrentState = State::Emitted;
23502350
}
2351+
clearList(Relocations);
23512352
}
23522353

23532354
/// Process LSDA information for the function.

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -370,33 +370,46 @@ class DataAggregator : public DataReader {
370370
/// memory.
371371
///
372372
/// File format syntax:
373-
/// {B|F|f|T} [<start_id>:]<start_offset> [<end_id>:]<end_offset> [<ft_end>]
374-
/// <count> [<mispred_count>]
373+
/// E <event>
374+
/// S <start> <count>
375+
/// T <start> <end> <ft_end> <count>
376+
/// B <start> <end> <count> <mispred_count>
377+
/// [Ff] <start> <end> <count>
375378
///
376-
/// B - indicates an aggregated branch
377-
/// F - an aggregated fall-through
379+
/// where <start>, <end>, <ft_end> have the format [<id>:]<offset>
380+
///
381+
/// E - name of the sampling event used for subsequent entries
382+
/// S - indicates an aggregated basic sample at <start>
383+
/// B - indicates an aggregated branch from <start> to <end>
384+
/// F - an aggregated fall-through from <start> to <end>
378385
/// f - an aggregated fall-through with external origin - used to disambiguate
379386
/// between a return hitting a basic block head and a regular internal
380387
/// jump to the block
381-
/// T - an aggregated trace: branch with a fall-through (from, to, ft_end)
382-
///
383-
/// <start_id> - build id of the object containing the start address. We can
384-
/// skip it for the main binary and use "X" for an unknown object. This will
385-
/// save some space and facilitate human parsing.
386-
///
387-
/// <start_offset> - hex offset from the object base load address (0 for the
388-
/// main executable unless it's PIE) to the start address.
388+
/// T - an aggregated trace: branch from <start> to <end> with a fall-through
389+
/// to <ft_end>
389390
///
390-
/// <end_id>, <end_offset> - same for the end address.
391+
/// <id> - build id of the object containing the address. We can skip it for
392+
/// the main binary and use "X" for an unknown object. This will save some
393+
/// space and facilitate human parsing.
391394
///
392-
/// <ft_end> - same for the fallthrough_end address.
395+
/// <offset> - hex offset from the object base load address (0 for the
396+
/// main executable unless it's PIE) to the address.
393397
///
394-
/// <count> - total aggregated count of the branch or a fall-through.
398+
/// <count> - total aggregated count.
395399
///
396400
/// <mispred_count> - the number of times the branch was mispredicted.
397-
/// Omitted for fall-throughs.
398401
///
399402
/// Example:
403+
/// Basic samples profile:
404+
/// E cycles
405+
/// S 41be50 3
406+
/// E br_inst_retired.near_taken
407+
/// S 41be60 6
408+
///
409+
/// Trace profile combining branches and fall-throughs:
410+
/// T 4b196f 4b19e0 4b19ef 2
411+
///
412+
/// Legacy branch profile with separate branches and fall-throughs:
400413
/// F 41be50 41be50 3
401414
/// F 41be90 41be90 4
402415
/// B 4b1942 39b57f0 3 0

bolt/include/bolt/Profile/Heatmap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ class Heatmap {
8585
void printSectionHotness(raw_ostream &OS) const;
8686

8787
size_t size() const { return Map.size(); }
88+
89+
/// Increase bucket size to \p NewSize, recomputing the heatmap.
90+
void resizeBucket(uint64_t NewSize);
8891
};
8992

9093
} // namespace bolt

bolt/include/bolt/Utils/CommandLineOpts.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ enum HeatmapModeKind {
2323
HM_Optional // perf2bolt --heatmap
2424
};
2525

26+
using HeatmapBlockSizes = std::vector<unsigned>;
27+
struct HeatmapBlockSpecParser : public llvm::cl::parser<HeatmapBlockSizes> {
28+
explicit HeatmapBlockSpecParser(llvm::cl::Option &O)
29+
: llvm::cl::parser<HeatmapBlockSizes>(O) {}
30+
// Return true on error.
31+
bool parse(llvm::cl::Option &O, llvm::StringRef ArgName, llvm::StringRef Arg,
32+
HeatmapBlockSizes &Val);
33+
};
34+
2635
extern HeatmapModeKind HeatmapMode;
2736
extern bool BinaryAnalysisMode;
2837

@@ -47,7 +56,8 @@ extern llvm::cl::opt<bool> EqualizeBBCounts;
4756
extern llvm::cl::opt<bool> ForcePatch;
4857
extern llvm::cl::opt<bool> RemoveSymtab;
4958
extern llvm::cl::opt<unsigned> ExecutionCountThreshold;
50-
extern llvm::cl::opt<unsigned> HeatmapBlock;
59+
extern llvm::cl::opt<HeatmapBlockSizes, false, HeatmapBlockSpecParser>
60+
HeatmapBlock;
5161
extern llvm::cl::opt<unsigned long long> HeatmapMaxAddress;
5262
extern llvm::cl::opt<unsigned long long> HeatmapMinAddress;
5363
extern llvm::cl::opt<bool> HeatmapPrintMappings;

bolt/lib/Core/BinaryContext.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,10 +1032,8 @@ void BinaryContext::adjustCodePadding() {
10321032

10331033
if (!hasValidCodePadding(BF)) {
10341034
if (HasRelocations) {
1035-
if (opts::Verbosity >= 1) {
1036-
this->outs() << "BOLT-INFO: function " << BF
1037-
<< " has invalid padding. Ignoring the function.\n";
1038-
}
1035+
this->errs() << "BOLT-WARNING: function " << BF
1036+
<< " has invalid padding. Ignoring the function\n";
10391037
BF.setIgnored();
10401038
} else {
10411039
BF.setMaxSize(BF.getSize());

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,6 @@ Error BinaryFunction::disassemble() {
15261526
if (uint64_t Offset = getFirstInstructionOffset())
15271527
Labels[Offset] = BC.Ctx->createNamedTempSymbol();
15281528

1529-
clearList(Relocations);
1530-
15311529
if (!IsSimple) {
15321530
clearList(Instructions);
15331531
return createNonFatalBOLTError("");
@@ -3244,16 +3242,26 @@ void BinaryFunction::setTrapOnEntry() {
32443242
}
32453243

32463244
void BinaryFunction::setIgnored() {
3245+
IsIgnored = true;
3246+
32473247
if (opts::processAllFunctions()) {
32483248
// We can accept ignored functions before they've been disassembled.
3249-
// In that case, they would still get disassembled and emited, but not
3249+
// In that case, they would still get disassembled and emitted, but not
32503250
// optimized.
3251-
assert(CurrentState == State::Empty &&
3252-
"cannot ignore non-empty functions in current mode");
3253-
IsIgnored = true;
3251+
if (CurrentState != State::Empty) {
3252+
BC.errs() << "BOLT-ERROR: cannot ignore non-empty function " << *this
3253+
<< " in current mode\n";
3254+
exit(1);
3255+
}
32543256
return;
32553257
}
32563258

3259+
IsSimple = false;
3260+
LLVM_DEBUG(dbgs() << "Ignoring " << getPrintName() << '\n');
3261+
3262+
if (CurrentState == State::Empty)
3263+
return;
3264+
32573265
clearDisasmState();
32583266

32593267
// Clear CFG state too.
@@ -3273,9 +3281,11 @@ void BinaryFunction::setIgnored() {
32733281

32743282
CurrentState = State::Empty;
32753283

3276-
IsIgnored = true;
3277-
IsSimple = false;
3278-
LLVM_DEBUG(dbgs() << "Ignoring " << getPrintName() << '\n');
3284+
// Fix external references in the original function body.
3285+
if (BC.HasRelocations) {
3286+
LLVM_DEBUG(dbgs() << "Scanning refs in " << *this << '\n');
3287+
scanExternalRefs();
3288+
}
32793289
}
32803290

32813291
void BinaryFunction::duplicateConstantIslands() {
@@ -3764,7 +3774,6 @@ void BinaryFunction::postProcessBranches() {
37643774

37653775
MCSymbol *BinaryFunction::addEntryPointAtOffset(uint64_t Offset) {
37663776
assert(Offset && "cannot add primary entry point");
3767-
assert(CurrentState == State::Empty || CurrentState == State::Disassembled);
37683777

37693778
const uint64_t EntryPointAddress = getAddress() + Offset;
37703779
MCSymbol *LocalSymbol = getOrCreateLocalLabel(EntryPointAddress);
@@ -3773,6 +3782,8 @@ MCSymbol *BinaryFunction::addEntryPointAtOffset(uint64_t Offset) {
37733782
if (EntrySymbol)
37743783
return EntrySymbol;
37753784

3785+
assert(CurrentState == State::Empty || CurrentState == State::Disassembled);
3786+
37763787
if (BinaryData *EntryBD = BC.getBinaryDataAtAddress(EntryPointAddress)) {
37773788
EntrySymbol = EntryBD->getSymbol();
37783789
} else {

bolt/lib/Passes/ADRRelaxationPass.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,15 @@ void ADRRelaxationPass::runOnFunction(BinaryFunction &BF) {
8181
It = BB.eraseInstruction(std::prev(It));
8282
} else if (std::next(It) != BB.end() && BC.MIB->isNoop(*std::next(It))) {
8383
BB.eraseInstruction(std::next(It));
84-
} else if (!opts::StrictMode && !BF.isSimple()) {
84+
} else if (!BF.isSimple()) {
8585
// If the function is not simple, it may contain a jump table undetected
8686
// by us. This jump table may use an offset from the branch instruction
8787
// to land in the desired place. If we add new instructions, we
8888
// invalidate this offset, so we have to rely on linker-inserted NOP to
8989
// replace it with ADRP, and abort if it is not present.
9090
auto L = BC.scopeLock();
91-
BC.errs() << formatv(
92-
"BOLT-ERROR: Cannot relax adr in non-simple function "
93-
"{0}. Use --strict option to override\n",
94-
BF.getOneName());
91+
BC.errs() << "BOLT-ERROR: cannot relax ADR in non-simple function "
92+
<< BF << '\n';
9593
PassFailed = true;
9694
return;
9795
}

0 commit comments

Comments
 (0)