Skip to content

Commit 11819d6

Browse files
committed
[AutoBump] Merge with bd56950 (Jan 22)
2 parents a3df9cb + bd56950 commit 11819d6

File tree

879 files changed

+48427
-22326
lines changed

Some content is hidden

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

879 files changed

+48427
-22326
lines changed

.github/workflows/build-ci-container.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
2828
container-name-agent-tag: ${{ steps.vars.outputs.container-name-agent-tag }}
2929
container-filename: ${{ steps.vars.outputs.container-filename }}
30+
container-agent-filename: ${{ steps.vars.outputs.container-agent-filename }}
3031
steps:
3132
- name: Checkout LLVM
3233
uses: actions/checkout@v4
@@ -42,6 +43,7 @@ jobs:
4243
echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
4344
echo "container-name-agent-tag=$container_name-agent:$tag" >> $GITHUB_OUTPUT
4445
echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
46+
echo "container-agent-filename=$(echo $container_name-agent:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
4547
- name: Build container
4648
working-directory: ./.github/workflows/containers/github-action-ci/
4749
run: |
@@ -53,13 +55,14 @@ jobs:
5355
# maintain minimal permissions while building the container.
5456
- name: Save container image
5557
run: |
56-
podman save ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-filename }}
58+
podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
59+
podman save ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-agent-filename }}
5760
5861
- name: Upload container image
5962
uses: actions/upload-artifact@v4
6063
with:
6164
name: container
62-
path: ${{ steps.vars.outputs.container-filename }}
65+
path: "*.tar"
6366
retention-days: 14
6467

6568
- name: Test Container
@@ -92,6 +95,7 @@ jobs:
9295
podman push ${{ needs.build-ci-container.outputs.container-name-tag }}
9396
podman push ${{ needs.build-ci-container.outputs.container-name }}:latest
9497
98+
podman load -i ${{ needs.build-ci-container.outputs.container-agent-filename }}
9599
podman tag ${{ needs.build-ci-container.outputs.container-name-agent-tag }} ${{ needs.build-ci-container.outputs.container-name-agent }}:latest
96100
podman push ${{ needs.build-ci-container.outputs.container-name-agent-tag }}
97101
podman push ${{ needs.build-ci-container.outputs.container-name-agent }}:latest

.github/workflows/libclang-abi-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
sed -i 's/LLVM_[0-9]\+/LLVM_NOVERSION/' $lib-${{ matrix.ref }}.abi
131131
done
132132
- name: Upload ABI file
133-
uses: actions/upload-artifact@v3
133+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
134134
with:
135135
name: ${{ matrix.name }}
136136
path: '*${{ matrix.ref }}.abi'
@@ -143,12 +143,12 @@ jobs:
143143
- abi-dump
144144
steps:
145145
- name: Download baseline
146-
uses: actions/download-artifact@v3
146+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
147147
with:
148148
name: build-baseline
149149
path: build-baseline
150150
- name: Download latest
151-
uses: actions/download-artifact@v3
151+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
152152
with:
153153
name: build-latest
154154
path: build-latest
@@ -162,7 +162,7 @@ jobs:
162162
done
163163
- name: Upload ABI Comparison
164164
if: always()
165-
uses: actions/upload-artifact@v3
165+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
166166
with:
167167
name: compat-report-${{ github.sha }}
168168
path: compat_reports/

.github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ jobs:
9292
check_run_id: check_run_id
9393
})
9494
95+
// For temporary debugging purposes to see the structure of the annotations.
96+
console.log(annotations);
97+
98+
has_failed_job = false;
99+
saved_failure_message = null;
100+
95101
for (annotation of annotations.data) {
96102
if (annotation.annotation_level != 'failure') {
97103
continue;
@@ -106,15 +112,32 @@ jobs:
106112
107113
const failure_match = annotation.message.match(failure_regex);
108114
if (failure_match != null) {
109-
// We only want to restart the workflow if all of the failures were due to preemption.
110-
// We don't want to restart the workflow if there were other failures.
111-
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
112-
'Failure message: "' + annotation.message + '"');
113-
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
114-
+ 'Failure message: ' + annotation.message)
115-
return;
115+
has_failed_job = true;
116+
saved_failure_message = annotation.message;
116117
}
117118
}
119+
if (has_failed_job && (! has_preempted_job)) {
120+
// We only want to restart the workflow if all of the failures were due to preemption.
121+
// We don't want to restart the workflow if there were other failures.
122+
//
123+
// However, libcxx runners running inside docker containers produce both a preemption message and failure message.
124+
//
125+
// The desired approach is to ignore failure messages which appear on the same job as a preemption message
126+
// (An job is a single run with a specific configuration, ex generic-gcc, gcc-14).
127+
//
128+
// However, it's unclear that this code achieves the desired approach, and it may ignore all failures
129+
// if a preemption message is found at all on any run.
130+
//
131+
// For now, it's more important to restart preempted workflows than to avoid restarting workflows with
132+
// non-preemption failures.
133+
//
134+
// TODO Figure this out.
135+
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
136+
'Failure message: "' + saved_failure_message + '"');
137+
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
138+
+ 'Failure message: ' + saved_failure_message)
139+
return;
140+
}
118141
}
119142
120143
if (!has_preempted_job) {

.github/workflows/llvm-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ jobs:
137137
# Remove symbol versioning from dumps, so we can compare across major versions.
138138
sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi
139139
- name: Upload ABI file
140-
uses: actions/upload-artifact@v3
140+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
141141
with:
142142
name: ${{ matrix.name }}
143143
path: ${{ matrix.ref }}.abi
144144

145145
- name: Upload symbol list file
146146
if: matrix.name == 'build-baseline'
147-
uses: actions/upload-artifact@v3
147+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
148148
with:
149149
name: symbol-list
150150
path: llvm.symbols
@@ -157,17 +157,17 @@ jobs:
157157
- abi-dump
158158
steps:
159159
- name: Download baseline
160-
uses: actions/download-artifact@v3
160+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
161161
with:
162162
name: build-baseline
163163
path: build-baseline
164164
- name: Download latest
165-
uses: actions/download-artifact@v3
165+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
166166
with:
167167
name: build-latest
168168
path: build-latest
169169
- name: Download symbol list
170-
uses: actions/download-artifact@v3
170+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
171171
with:
172172
name: symbol-list
173173
path: symbol-list
@@ -186,7 +186,7 @@ jobs:
186186
abi-compliance-checker $EXTRA_ARGS -l libLLVM.so -old build-baseline/*.abi -new build-latest/*.abi || test "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c"
187187
- name: Upload ABI Comparison
188188
if: always()
189-
uses: actions/upload-artifact@v3
189+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
190190
with:
191191
name: compat-report-${{ github.sha }}
192192
path: compat_reports/

.github/workflows/premerge.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ jobs:
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
2020
cancel-in-progress: true
21-
container:
22-
image: ghcr.io/llvm/ci-ubuntu-22.04:latest
23-
defaults:
24-
run:
25-
shell: bash
2621
steps:
2722
- name: Checkout LLVM
2823
uses: actions/checkout@v4

.github/workflows/release-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
./llvm/utils/release/build-docs.sh -release "${{ inputs.release-version }}" -no-doxygen
6060
6161
- name: Create Release Notes Artifact
62-
uses: actions/upload-artifact@v3
62+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
6363
with:
6464
name: release-notes
6565
path: docs-build/html-export/

.github/workflows/spirv-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ jobs:
2525
with:
2626
build_target: check-llvm-codegen-spirv
2727
projects:
28-
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="SPIRV" -DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON'
28+
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="SPIRV" -DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON'
2929
os_list: '["ubuntu-22.04"]'

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class DataAggregator : public DataReader {
8080
private:
8181
struct PerfBranchSample {
8282
SmallVector<LBREntry, 32> LBR;
83-
uint64_t PC;
8483
};
8584

8685
struct PerfBasicSample {
@@ -334,9 +333,6 @@ class DataAggregator : public DataReader {
334333
/// Process all branch events.
335334
void processBranchEvents();
336335

337-
/// This member function supports generating data for AutoFDO LLVM tools.
338-
std::error_code writeAutoFDOData(StringRef OutputFilename);
339-
340336
/// Parse the full output generated by perf script to report non-LBR samples.
341337
std::error_code parseBasicEvents();
342338

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 9 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,6 @@ TimeAggregator("time-aggr",
108108
cl::ZeroOrMore,
109109
cl::cat(AggregatorCategory));
110110

111-
static cl::opt<bool>
112-
UseEventPC("use-event-pc",
113-
cl::desc("use event PC in combination with LBR sampling"),
114-
cl::cat(AggregatorCategory));
115-
116-
static cl::opt<bool> WriteAutoFDOData(
117-
"autofdo", cl::desc("generate autofdo textual data instead of bolt data"),
118-
cl::cat(AggregatorCategory));
119-
120111
} // namespace opts
121112

122113
namespace {
@@ -187,15 +178,13 @@ void DataAggregator::start() {
187178
/*Wait = */false);
188179
} else if (!opts::ITraceAggregation.empty()) {
189180
std::string ItracePerfScriptArgs = llvm::formatv(
190-
"script -F pid,ip,brstack --itrace={0}", opts::ITraceAggregation);
181+
"script -F pid,brstack --itrace={0}", opts::ITraceAggregation);
191182
launchPerfProcess("branch events with itrace", MainEventsPPI,
192183
ItracePerfScriptArgs.c_str(),
193184
/*Wait = */ false);
194185
} else {
195-
launchPerfProcess("branch events",
196-
MainEventsPPI,
197-
"script -F pid,ip,brstack",
198-
/*Wait = */false);
186+
launchPerfProcess("branch events", MainEventsPPI, "script -F pid,brstack",
187+
/*Wait = */ false);
199188
}
200189

201190
// Note: we launch script for mem events regardless of the option, as the
@@ -381,67 +370,6 @@ void DataAggregator::parsePreAggregated() {
381370
}
382371
}
383372

384-
std::error_code DataAggregator::writeAutoFDOData(StringRef OutputFilename) {
385-
outs() << "PERF2BOLT: writing data for autofdo tools...\n";
386-
NamedRegionTimer T("writeAutoFDO", "Processing branch events", TimerGroupName,
387-
TimerGroupDesc, opts::TimeAggregator);
388-
389-
std::error_code EC;
390-
raw_fd_ostream OutFile(OutputFilename, EC, sys::fs::OpenFlags::OF_None);
391-
if (EC)
392-
return EC;
393-
394-
// Format:
395-
// number of unique traces
396-
// from_1-to_1:count_1
397-
// from_2-to_2:count_2
398-
// ......
399-
// from_n-to_n:count_n
400-
// number of unique sample addresses
401-
// addr_1:count_1
402-
// addr_2:count_2
403-
// ......
404-
// addr_n:count_n
405-
// number of unique LBR entries
406-
// src_1->dst_1:count_1
407-
// src_2->dst_2:count_2
408-
// ......
409-
// src_n->dst_n:count_n
410-
411-
const uint64_t FirstAllocAddress = this->BC->FirstAllocAddress;
412-
413-
// AutoFDO addresses are relative to the first allocated loadable program
414-
// segment
415-
auto filterAddress = [&FirstAllocAddress](uint64_t Address) -> uint64_t {
416-
if (Address < FirstAllocAddress)
417-
return 0;
418-
return Address - FirstAllocAddress;
419-
};
420-
421-
OutFile << FallthroughLBRs.size() << "\n";
422-
for (const auto &[Trace, Info] : FallthroughLBRs) {
423-
OutFile << formatv("{0:x-}-{1:x-}:{2}\n", filterAddress(Trace.From),
424-
filterAddress(Trace.To),
425-
Info.InternCount + Info.ExternCount);
426-
}
427-
428-
OutFile << BasicSamples.size() << "\n";
429-
for (const auto [PC, HitCount] : BasicSamples)
430-
OutFile << formatv("{0:x-}:{1}\n", filterAddress(PC), HitCount);
431-
432-
OutFile << BranchLBRs.size() << "\n";
433-
for (const auto &[Trace, Info] : BranchLBRs) {
434-
OutFile << formatv("{0:x-}->{1:x-}:{2}\n", filterAddress(Trace.From),
435-
filterAddress(Trace.To), Info.TakenCount);
436-
}
437-
438-
outs() << "PERF2BOLT: wrote " << FallthroughLBRs.size() << " unique traces, "
439-
<< BasicSamples.size() << " sample addresses and " << BranchLBRs.size()
440-
<< " unique branches to " << OutputFilename << "\n";
441-
442-
return std::error_code();
443-
}
444-
445373
void DataAggregator::filterBinaryMMapInfo() {
446374
if (opts::FilterPID) {
447375
auto MMapInfoIter = BinaryMMapInfo.find(opts::FilterPID);
@@ -583,15 +511,6 @@ Error DataAggregator::preprocessProfile(BinaryContext &BC) {
583511
(opts::BasicAggregation && parseBasicEvents()))
584512
errs() << "PERF2BOLT: failed to parse samples\n";
585513

586-
// We can finish early if the goal is just to generate data for autofdo
587-
if (opts::WriteAutoFDOData) {
588-
if (std::error_code EC = writeAutoFDOData(opts::OutputFilename))
589-
errs() << "Error writing autofdo data to file: " << EC.message() << "\n";
590-
591-
deleteTempFiles();
592-
exit(0);
593-
}
594-
595514
// Special handling for memory events
596515
if (prepareToParse("mem events", MemEventsPPI, MemEventsErrorCallback))
597516
return Error::success();
@@ -1158,14 +1077,6 @@ ErrorOr<DataAggregator::PerfBranchSample> DataAggregator::parseBranchSample() {
11581077
return make_error_code(errc::no_such_process);
11591078
}
11601079

1161-
while (checkAndConsumeFS()) {
1162-
}
1163-
1164-
ErrorOr<uint64_t> PCRes = parseHexField(FieldSeparator, true);
1165-
if (std::error_code EC = PCRes.getError())
1166-
return EC;
1167-
Res.PC = PCRes.get();
1168-
11691080
if (checkAndConsumeNewLine())
11701081
return Res;
11711082

@@ -1472,9 +1383,9 @@ std::error_code DataAggregator::printLBRHeatMap() {
14721383
uint64_t DataAggregator::parseLBRSample(const PerfBranchSample &Sample,
14731384
bool NeedsSkylakeFix) {
14741385
uint64_t NumTraces{0};
1475-
// LBRs are stored in reverse execution order. NextPC refers to the next
1476-
// recorded executed PC.
1477-
uint64_t NextPC = opts::UseEventPC ? Sample.PC : 0;
1386+
// LBRs are stored in reverse execution order. NextLBR refers to the next
1387+
// executed branch record.
1388+
const LBREntry *NextLBR = nullptr;
14781389
uint32_t NumEntry = 0;
14791390
for (const LBREntry &LBR : Sample.LBR) {
14801391
++NumEntry;
@@ -1486,10 +1397,10 @@ uint64_t DataAggregator::parseLBRSample(const PerfBranchSample &Sample,
14861397
// chronological order)
14871398
if (NeedsSkylakeFix && NumEntry <= 2)
14881399
continue;
1489-
if (NextPC) {
1400+
if (NextLBR) {
14901401
// Record fall-through trace.
14911402
const uint64_t TraceFrom = LBR.To;
1492-
const uint64_t TraceTo = NextPC;
1403+
const uint64_t TraceTo = NextLBR->From;
14931404
const BinaryFunction *TraceBF =
14941405
getBinaryFunctionContainingAddress(TraceFrom);
14951406
if (TraceBF && TraceBF->containsAddress(TraceTo)) {
@@ -1524,7 +1435,7 @@ uint64_t DataAggregator::parseLBRSample(const PerfBranchSample &Sample,
15241435
}
15251436
++NumTraces;
15261437
}
1527-
NextPC = LBR.From;
1438+
NextLBR = &LBR;
15281439

15291440
uint64_t From = getBinaryFunctionContainingAddress(LBR.From) ? LBR.From : 0;
15301441
uint64_t To = getBinaryFunctionContainingAddress(LBR.To) ? LBR.To : 0;
@@ -1561,8 +1472,6 @@ std::error_code DataAggregator::parseBranchEvents() {
15611472
++NumSamples;
15621473

15631474
PerfBranchSample &Sample = SampleRes.get();
1564-
if (opts::WriteAutoFDOData)
1565-
++BasicSamples[Sample.PC];
15661475

15671476
if (Sample.LBR.empty()) {
15681477
++NumSamplesNoLBR;

0 commit comments

Comments
 (0)