Skip to content

Commit aa5d83c

Browse files
author
kr-2003
committed
Merge branch 'main' of https://github.com/kr-2003/llvm-project into redirection
2 parents 58bb645 + d889a74 commit aa5d83c

File tree

3,065 files changed

+138978
-99268
lines changed

Some content is hidden

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

3,065 files changed

+138978
-99268
lines changed

.ci/monolithic-linux.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ runtime_targets_needs_reconfig="${5}"
5656

5757
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5858

59-
echo "--- cmake"
59+
echo "::group::cmake"
6060
export PIP_BREAK_SYSTEM_PACKAGES=1
6161
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
6262

@@ -85,38 +85,49 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8585
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
8686
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
8787

88-
echo "--- ninja"
88+
echo "::endgroup::"
89+
echo "::group::ninja"
90+
8991
# Targets are not escaped as they are passed as separate arguments.
9092
ninja -C "${BUILD_DIR}" -k 0 ${targets}
9193

94+
echo "::endgroup::"
95+
9296
if [[ "${runtime_targets}" != "" ]]; then
93-
echo "--- ninja runtimes"
97+
echo "::group::ninja runtimes"
9498

9599
ninja -C "${BUILD_DIR}" ${runtime_targets}
100+
101+
echo "::endgroup::"
96102
fi
97103

98104
# Compiling runtimes with just-built Clang and running their tests
99105
# as an additional testing for Clang.
100106
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
101-
echo "--- cmake runtimes C++26"
107+
echo "::group::cmake runtimes C++26"
102108

103109
cmake \
104110
-D LIBCXX_TEST_PARAMS="std=c++26" \
105111
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
106112
"${BUILD_DIR}"
107113

108-
echo "--- ninja runtimes C++26"
114+
echo "::endgroup::"
115+
echo "::group::ninja runtimes C++26"
109116

110117
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
111118

112-
echo "--- cmake runtimes clang modules"
119+
echo "::endgroup::"
120+
echo "::group::cmake runtimes clang modules"
113121

114122
cmake \
115123
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
116124
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
117125
"${BUILD_DIR}"
118126

119-
echo "--- ninja runtimes clang modules"
127+
echo "::endgroup::"
128+
echo "::group::ninja runtimes clang modules"
120129

121130
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
131+
132+
echo "::endgroup::"
122133
fi

.ci/monolithic-windows.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ trap at-exit EXIT
4646
projects="${1}"
4747
targets="${2}"
4848

49-
echo "--- cmake"
49+
echo "::group::cmake"
5050
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
5151

5252
export CC=cl
@@ -78,6 +78,10 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7878
-D LLVM_PARALLEL_COMPILE_JOBS=${MAX_PARALLEL_COMPILE_JOBS} \
7979
-D LLVM_PARALLEL_LINK_JOBS=${MAX_PARALLEL_LINK_JOBS}
8080

81-
echo "--- ninja"
81+
echo "::endgroup::"
82+
echo "::group::ninja"
83+
8284
# Targets are not escaped as they are passed as separate arguments.
8385
ninja -C "${BUILD_DIR}" -k 0 ${targets}
86+
87+
echo "::endgroup"

.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.325.0
88+
ARG RUNNER_VERSION=2.326.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.325.0
89+
ENV GITHUB_RUNNER_VERSION=2.326.0
9090

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

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,40 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
build_type: [Debug, Release, MinSizeRel]
18+
# Build basic linux configuration with Debug/Release/MinSizeRel and all
19+
# other configurations in Debug only.
1920
include:
2021
- os: ubuntu-24.04
22+
build_type: Debug
23+
ccache-variant: sccache
24+
c_compiler: clang-21
25+
cpp_compiler: clang++-21
26+
target: x86_64-unknown-linux-llvm
27+
include_scudo: ON
28+
- os: ubuntu-24.04
29+
build_type: Release
30+
ccache-variant: sccache
31+
c_compiler: clang-21
32+
cpp_compiler: clang++-21
33+
target: x86_64-unknown-linux-llvm
34+
include_scudo: ON
35+
- os: ubuntu-24.04
36+
build_type: MinSizeRel
2137
ccache-variant: sccache
2238
c_compiler: clang-21
2339
cpp_compiler: clang++-21
2440
target: x86_64-unknown-linux-llvm
2541
include_scudo: ON
2642
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
2743
- os: ubuntu-24.04-arm
44+
build_type: Debug
2845
ccache-variant: ccache
2946
c_compiler: clang-21
3047
cpp_compiler: clang++-21
3148
target: aarch64-unknown-linux-llvm
3249
include_scudo: ON
3350
- os: ubuntu-24.04
51+
build_type: Debug
3452
ccache-variant: ccache
3553
c_compiler: clang-21
3654
cpp_compiler: clang++-21
@@ -97,7 +115,7 @@ jobs:
97115
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
98116
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
99117
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
100-
-DLLVM_RUNTIMES_TARGET=${{ matrix.target }} \
118+
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
101119
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
102120
-DLLVM_LIBC_FULL_BUILD=ON \
103121
-G Ninja \

.github/workflows/libc-overlay-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
1717
fail-fast: false
1818
matrix:
19-
build_type: [Debug, Release, MinSizeRel]
19+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022, windows-2025, macos-14]
2020
include:
2121
# TODO: add linux gcc when it is fixed
2222
- os: ubuntu-24.04
@@ -96,7 +96,7 @@ jobs:
9696
cmake -B ${{ steps.strings.outputs.build-output-dir }}
9797
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9898
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
99-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
99+
-DCMAKE_BUILD_TYPE=Debug
100100
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101101
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
102102
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
@@ -110,7 +110,6 @@ jobs:
110110
cmake
111111
--build ${{ steps.strings.outputs.build-output-dir }}
112112
--parallel
113-
--config MinSizeRel
114113
--target libc
115114
116115
- name: Test

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

Lines changed: 4 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020

2121
jobs:
2222
restart:
23-
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled')
23+
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure')
2424
name: "Restart Job"
2525
permissions:
2626
statuses: read
@@ -35,8 +35,8 @@ jobs:
3535
// The "The run was canceled by" message comes from a user manually canceling a workflow
3636
// the "higher priority" message comes from github canceling a workflow because the user updated the change.
3737
// And the "exit code 1" message indicates a genuine failure.
38-
const failure_regex = /(Process completed with exit code 1.)|(Canceling since a higher priority waiting request)|(The run was canceled by)/
39-
const preemption_regex = /(The runner has received a shutdown signal)/
38+
const failure_regex = /(Process completed with exit code 1.)/
39+
const preemption_regex = /(The runner has received a shutdown signal)|(The operation was canceled)/
4040
4141
const wf_run = context.payload.workflow_run
4242
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
@@ -77,7 +77,7 @@ jobs:
7777
console.log('Check run was not completed. Skipping.');
7878
continue;
7979
}
80-
if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') {
80+
if (check_run.conclusion != 'failure') {
8181
console.log('Check run had conclusion: ' + check_run.conclusion + '. Skipping.');
8282
continue;
8383
}
@@ -156,91 +156,3 @@ jobs:
156156
run_id: context.payload.workflow_run.id
157157
})
158158
await create_check_run('success', 'Restarted workflow run due to preempted job')
159-
160-
restart-test:
161-
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') && github.event.actor.login == 'ldionne' # TESTING ONLY
162-
name: "Restart Job (test)"
163-
permissions:
164-
statuses: read
165-
checks: write
166-
actions: write
167-
runs-on: ubuntu-24.04
168-
steps:
169-
- name: "Restart Job (test)"
170-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
171-
with:
172-
script: |
173-
const FAILURE_REGEX = /(Process completed with exit code 1.)|(Canceling since a higher priority waiting request)|(The run was canceled by)/
174-
const PREEMPTION_REGEX = /(The runner has received a shutdown signal)|(The operation was canceled)/
175-
176-
function log(msg) {
177-
core.notice(msg)
178-
}
179-
180-
const wf_run = context.payload.workflow_run
181-
log(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
182-
183-
log('Listing check runs for suite')
184-
const check_suites = await github.rest.checks.listForSuite({
185-
owner: context.repo.owner,
186-
repo: context.repo.repo,
187-
check_suite_id: context.payload.workflow_run.check_suite_id,
188-
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better.
189-
})
190-
191-
preemptions = [];
192-
legitimate_failures = [];
193-
for (check_run of check_suites.data.check_runs) {
194-
log(`Checking check run: ${check_run.id}`);
195-
if (check_run.status != 'completed') {
196-
log('Check run was not completed. Skipping.');
197-
continue;
198-
}
199-
200-
if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') {
201-
log(`Check run had conclusion: ${check_run.conclusion}. Skipping.`);
202-
continue;
203-
}
204-
205-
annotations = await github.rest.checks.listAnnotations({
206-
owner: context.repo.owner,
207-
repo: context.repo.repo,
208-
check_run_id: check_run.id
209-
})
210-
211-
preemption_annotation = annotations.data.find(function(annotation) {
212-
return annotation.annotation_level == 'failure' &&
213-
annotation.message.match(PREEMPTION_REGEX) != null;
214-
});
215-
if (preemption_annotation != null) {
216-
log(`Found preemption message: ${preemption_annotation.message}`);
217-
preemptions.push(check_run);
218-
break;
219-
}
220-
221-
failure_annotation = annotations.data.find(function(annotation) {
222-
return annotation.annotation_level == 'failure' &&
223-
annotation.message.match(FAILURE_REGEX) != null;
224-
});
225-
if (failure_annotation != null) {
226-
log(`Found legitimate failure annotation: ${failure_annotation.message}`);
227-
legitimate_failures.push(check_run);
228-
break;
229-
}
230-
}
231-
232-
if (preemptions) {
233-
log('Found some preempted jobs');
234-
if (legitimate_failures) {
235-
log('Also found some legitimate failures, so not restarting the workflow.');
236-
} else {
237-
log('Did not find any legitimate failures. Restarting workflow.');
238-
await github.rest.actions.reRunWorkflowFailedJobs({
239-
owner: context.repo.owner,
240-
repo: context.repo.repo,
241-
run_id: context.payload.workflow_run.id
242-
})
243-
}
244-
} else {
245-
log('Did not find any preempted jobs. Not restarting the workflow.');
246-
}

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ struct SegmentInfo {
7373
uint64_t FileSize; /// Size in file.
7474
uint64_t Alignment; /// Alignment of the segment.
7575
bool IsExecutable; /// Is the executable bit set on the Segment?
76+
bool IsWritable; /// Is the segment writable.
7677

7778
void print(raw_ostream &OS) const {
7879
OS << "SegmentInfo { Address: 0x" << Twine::utohexstr(Address)
7980
<< ", Size: 0x" << Twine::utohexstr(Size) << ", FileOffset: 0x"
8081
<< Twine::utohexstr(FileOffset) << ", FileSize: 0x"
8182
<< Twine::utohexstr(FileSize) << ", Alignment: 0x"
82-
<< Twine::utohexstr(Alignment) << ", " << (IsExecutable ? "x" : " ")
83-
<< "}";
83+
<< Twine::utohexstr(Alignment) << ", " << (IsExecutable ? "x" : "")
84+
<< (IsWritable ? "w" : "") << " }";
8485
};
8586
};
8687

@@ -333,9 +334,14 @@ class BinaryContext {
333334
std::optional<StringRef> Source,
334335
unsigned CUID, unsigned DWARFVersion);
335336

337+
/// Input file segment info
338+
///
336339
/// [start memory address] -> [segment info] mapping.
337340
std::map<uint64_t, SegmentInfo> SegmentMapInfo;
338341

342+
/// Newly created segments.
343+
std::vector<SegmentInfo> NewSegments;
344+
339345
/// Symbols that are expected to be undefined in MCContext during emission.
340346
std::unordered_set<MCSymbol *> UndefinedSymbols;
341347

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ class DataAggregator : public DataReader {
236236

237237
/// Launch a perf subprocess with given args and save output for later
238238
/// parsing.
239-
void launchPerfProcess(StringRef Name, PerfProcessInfo &PPI,
240-
const char *ArgsString, bool Wait);
239+
void launchPerfProcess(StringRef Name, PerfProcessInfo &PPI, StringRef Args);
241240

242241
/// Delete all temporary files created to hold the output generated by spawned
243242
/// subprocesses during the aggregation job

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ class RewriteInstance {
300300
return FUNC(ELF64BE); \
301301
}
302302

303+
/// Update loadable segment information based on new sections.
304+
void updateSegmentInfo();
305+
303306
/// Patch ELF book-keeping info.
304307
void patchELFPHDRTable();
305308

0 commit comments

Comments
 (0)