Skip to content

Commit 023d4ed

Browse files
Merge branch 'main' into views-concat
2 parents d0174fb + 646e4f2 commit 023d4ed

File tree

2,519 files changed

+88281
-39411
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,519 files changed

+88281
-39411
lines changed

.github/new-prs-labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ clang:static analyzer:
499499
- clang/tools/scan-build/**
500500
- clang/utils/analyzer/**
501501
- clang/docs/analyzer/**
502+
- clang/test/Analysis/**
502503

503504
pgo:
504505
- llvm/lib/Transforms/Instrumentation/CGProfile.cpp

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
3939
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
40+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
4141
continue-on-error: false
4242
strategy:
4343
fail-fast: false
@@ -48,8 +48,8 @@ jobs:
4848
'generic-cxx26',
4949
'generic-modules'
5050
]
51-
cc: [ 'clang-20' ]
52-
cxx: [ 'clang++-20' ]
51+
cc: [ 'clang-21' ]
52+
cxx: [ 'clang++-21' ]
5353
include:
5454
- config: 'generic-gcc'
5555
cc: 'gcc-14'
@@ -75,7 +75,7 @@ jobs:
7575
stage2:
7676
if: github.repository_owner == 'llvm'
7777
runs-on: libcxx-self-hosted-linux
78-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
78+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
7979
needs: [ stage1 ]
8080
continue-on-error: false
8181
strategy:
@@ -88,18 +88,22 @@ jobs:
8888
'generic-cxx20',
8989
'generic-cxx23'
9090
]
91-
cc: [ 'clang-20' ]
92-
cxx: [ 'clang++-20' ]
91+
cc: [ 'clang-21' ]
92+
cxx: [ 'clang++-21' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
9595
cc: 'gcc-14'
9696
cxx: 'g++-14'
97-
- config: 'generic-cxx23'
98-
cc: 'clang-18'
99-
cxx: 'clang++-18'
97+
- config: 'generic-cxx26'
98+
cc: 'clang-20'
99+
cxx: 'clang++-20'
100100
- config: 'generic-cxx26'
101101
cc: 'clang-19'
102102
cxx: 'clang++-19'
103+
# Release transition
104+
- config: 'generic-cxx23'
105+
cc: 'clang-18'
106+
cxx: 'clang++-18'
103107
steps:
104108
- uses: actions/checkout@v4
105109
- name: ${{ matrix.config }}
@@ -120,7 +124,7 @@ jobs:
120124
**/crash_diagnostics/*
121125
stage3:
122126
if: github.repository_owner == 'llvm'
123-
needs: [ stage1, stage2 ]
127+
needs: [ stage2 ]
124128
continue-on-error: false
125129
strategy:
126130
fail-fast: false
@@ -163,14 +167,14 @@ jobs:
163167
- config: 'generic-msan'
164168
machine: libcxx-self-hosted-linux
165169
runs-on: ${{ matrix.machine }}
166-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
170+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
167171
steps:
168172
- uses: actions/checkout@v4
169173
- name: ${{ matrix.config }}
170174
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171175
env:
172-
CC: clang-20
173-
CXX: clang++-20
176+
CC: clang-21
177+
CXX: clang++-21
174178
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175179
if: always()
176180
with:
@@ -184,7 +188,7 @@ jobs:
184188
**/crash_diagnostics/*
185189
186190
macos:
187-
needs: [ stage1 ]
191+
needs: [ stage3 ]
188192
strategy:
189193
fail-fast: false
190194
matrix:
@@ -228,7 +232,7 @@ jobs:
228232
229233
windows:
230234
runs-on: windows-2022
231-
needs: [ stage1 ]
235+
needs: [ stage2 ]
232236
strategy:
233237
fail-fast: false
234238
matrix:

.github/workflows/premerge.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ on:
1414
# do this is that it allows us to take advantage of concurrency groups
1515
# to cancel in progress CI jobs whenever the PR is closed.
1616
- closed
17-
paths:
18-
- .github/workflows/premerge.yaml
1917
push:
2018
branches:
2119
- 'main'

.github/workflows/release-binaries.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ jobs:
138138
arches=arm64
139139
else
140140
arches=x86_64
141+
# Disable Flang builds on macOS x86_64. The FortranLower library takes
142+
# 2-3 hours to build on macOS, much slower than on Linux.
143+
# The long build time causes the release build to time out on x86_64,
144+
# so we need to disable flang there.
145+
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS='clang;lld;lldb;clang-tools-extra;bolt;polly;mlir'"
141146
fi
142147
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
143148
fi

bolt/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,11 @@ endif()
202202

203203
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in
204204
${CMAKE_CURRENT_BINARY_DIR}/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc @ONLY)
205+
206+
set(BOLT_ENUM_TARGETS "")
207+
foreach(t ${BOLT_TARGETS_TO_BUILD})
208+
set(BOLT_ENUM_TARGETS "${BOLT_ENUM_TARGETS}BOLT_TARGET(${t})\n")
209+
endforeach(t)
210+
211+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/Core/TargetConfig.def.in
212+
${CMAKE_CURRENT_BINARY_DIR}/include/bolt/Core/TargetConfig.def @ONLY)

bolt/include/bolt/Core/Linker.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ class BOLTLinker {
4646
/// Return the address and size of a symbol or std::nullopt if it cannot be
4747
/// found.
4848
virtual std::optional<SymbolInfo> lookupSymbolInfo(StringRef Name) const = 0;
49-
50-
/// Return the address of a symbol or std::nullopt if it cannot be found.
51-
std::optional<uint64_t> lookupSymbol(StringRef Name) const {
52-
if (const auto Info = lookupSymbolInfo(Name))
53-
return Info->Address;
54-
return std::nullopt;
55-
}
5649
};
5750

5851
} // namespace bolt
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- TargetConfig.def.in - Information about available targets ---------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file is configured by the build system to define the available bolt
10+
// targets.
11+
//
12+
// The variant of this file not ending with .in has been autogenerated by the
13+
// LLVM build. Do not edit!
14+
//
15+
//===----------------------------------------------------------------------===//
16+
17+
#ifndef BOLT_TARGET
18+
# error Please define the macro BOLT_TARGET(TargetName)
19+
#endif
20+
21+
@BOLT_ENUM_TARGETS@
22+
23+
#undef BOLT_TARGET

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@ void BinaryFunction::print(raw_ostream &OS, std::string Annotation) {
498498
if (!IslandOffset)
499499
return;
500500

501+
// Print label if it exists at this offset.
502+
if (const BinaryData *BD =
503+
BC.getBinaryDataAtAddress(getAddress() + *IslandOffset))
504+
OS << BD->getName() << ":\n";
505+
501506
const size_t IslandSize = getSizeOfDataInCodeAt(*IslandOffset);
502507
BC.printData(OS, BC.extractData(getAddress() + *IslandOffset, IslandSize),
503508
*IslandOffset);
@@ -1066,7 +1071,7 @@ size_t BinaryFunction::getSizeOfDataInCodeAt(uint64_t Offset) const {
10661071
auto Iter = Islands->CodeOffsets.upper_bound(Offset);
10671072
if (Iter != Islands->CodeOffsets.end())
10681073
return *Iter - Offset;
1069-
return getSize() - Offset;
1074+
return getMaxSize() - Offset;
10701075
}
10711076

10721077
std::optional<uint64_t>
@@ -4254,21 +4259,21 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {
42544259

42554260
if (BC.HasRelocations || isInjected()) {
42564261
if (hasConstantIsland()) {
4257-
const auto DataAddress =
4258-
Linker.lookupSymbol(getFunctionConstantIslandLabel()->getName());
4259-
assert(DataAddress && "Cannot find function CI symbol");
4260-
setOutputDataAddress(*DataAddress);
4262+
const auto IslandLabelSymInfo =
4263+
Linker.lookupSymbolInfo(getFunctionConstantIslandLabel()->getName());
4264+
assert(IslandLabelSymInfo && "Cannot find function CI symbol");
4265+
setOutputDataAddress(IslandLabelSymInfo->Address);
42614266
for (auto It : Islands->Offsets) {
42624267
const uint64_t OldOffset = It.first;
42634268
BinaryData *BD = BC.getBinaryDataAtAddress(getAddress() + OldOffset);
42644269
if (!BD)
42654270
continue;
42664271

42674272
MCSymbol *Symbol = It.second;
4268-
const auto NewAddress = Linker.lookupSymbol(Symbol->getName());
4269-
assert(NewAddress && "Cannot find CI symbol");
4273+
const auto SymInfo = Linker.lookupSymbolInfo(Symbol->getName());
4274+
assert(SymInfo && "Cannot find CI symbol");
42704275
auto &Section = *getCodeSection();
4271-
const auto NewOffset = *NewAddress - Section.getOutputAddress();
4276+
const auto NewOffset = SymInfo->Address - Section.getOutputAddress();
42724277
BD->setOutputLocation(Section, NewOffset);
42734278
}
42744279
}
@@ -4293,10 +4298,10 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {
42934298
FF.setAddress(ColdStartSymbolInfo->Address);
42944299
FF.setImageSize(ColdStartSymbolInfo->Size);
42954300
if (hasConstantIsland()) {
4296-
const auto DataAddress = Linker.lookupSymbol(
4301+
const auto SymInfo = Linker.lookupSymbolInfo(
42974302
getFunctionColdConstantIslandLabel()->getName());
4298-
assert(DataAddress && "Cannot find cold CI symbol");
4299-
setOutputColdDataAddress(*DataAddress);
4303+
assert(SymInfo && "Cannot find cold CI symbol");
4304+
setOutputColdDataAddress(SymInfo->Address);
43004305
}
43014306
}
43024307
}

bolt/lib/Passes/Inliner.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ ForceInlineFunctions("force-inline",
4949
cl::Hidden,
5050
cl::cat(BoltOptCategory));
5151

52+
static cl::list<std::string> SkipInlineFunctions(
53+
"skip-inline", cl::CommaSeparated,
54+
cl::desc("list of functions to never consider for inlining"),
55+
cl::value_desc("func1,func2,func3,..."), cl::Hidden,
56+
cl::cat(BoltOptCategory));
57+
5258
static cl::opt<bool> InlineAll("inline-all", cl::desc("inline all functions"),
5359
cl::cat(BoltOptCategory));
5460

@@ -105,6 +111,12 @@ bool mustConsider(const llvm::bolt::BinaryFunction &Function) {
105111
return false;
106112
}
107113

114+
bool mustSkip(const llvm::bolt::BinaryFunction &Function) {
115+
return llvm::any_of(opts::SkipInlineFunctions, [&](const std::string &Name) {
116+
return Function.hasName(Name);
117+
});
118+
}
119+
108120
void syncOptions() {
109121
if (opts::InlineIgnoreCFI)
110122
opts::InlineIgnoreLeafCFI = true;
@@ -223,7 +235,7 @@ InliningInfo getInliningInfo(const BinaryFunction &BF) {
223235
void Inliner::findInliningCandidates(BinaryContext &BC) {
224236
for (const auto &BFI : BC.getBinaryFunctions()) {
225237
const BinaryFunction &Function = BFI.second;
226-
if (!shouldOptimize(Function))
238+
if (!shouldOptimize(Function) || opts::mustSkip(Function))
227239
continue;
228240
const InliningInfo InlInfo = getInliningInfo(Function);
229241
if (InlInfo.Type != INL_NONE)

bolt/lib/Rewrite/JITLinkLinker.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ struct JITLinkLinker::Context : jitlink::JITLinkContext {
125125
std::string SymName = (*Symbol.first).str();
126126
LLVM_DEBUG(dbgs() << "BOLT: looking for " << SymName << "\n");
127127

128-
if (auto Address = Linker.lookupSymbol(SymName)) {
128+
if (auto SymInfo = Linker.lookupSymbolInfo(SymName)) {
129129
LLVM_DEBUG(dbgs() << "Resolved to address 0x"
130-
<< Twine::utohexstr(*Address) << "\n");
130+
<< Twine::utohexstr(SymInfo->Address) << "\n");
131131
AllResults[Symbol.first] = orc::ExecutorSymbolDef(
132-
orc::ExecutorAddr(*Address), JITSymbolFlags());
132+
orc::ExecutorAddr(SymInfo->Address), JITSymbolFlags());
133133
continue;
134134
}
135135

0 commit comments

Comments
 (0)