Skip to content

Commit 1cff12b

Browse files
authored
Merge branch 'main' into users/kparzysz/spr/m01-applymem
2 parents a9f48dd + 1a830aa commit 1cff12b

File tree

715 files changed

+11293
-5168
lines changed

Some content is hidden

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

715 files changed

+11293
-5168
lines changed

.github/workflows/commit-access-review.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,47 @@ def check_manual_requests(
6767
) -> list[str]:
6868
"""
6969
Return a list of users who have been asked since ``start_date`` if they
70-
want to keep their commit access.
70+
want to keep their commit access or if they have applied for commit
71+
access since ``start_date``
7172
"""
73+
7274
query = """
73-
query ($query: String!) {
74-
search(query: $query, type: ISSUE, first: 100) {
75+
query ($query: String!, $after: String) {
76+
search(query: $query, type: ISSUE, first: 100, after: $after) {
7577
nodes {
7678
... on Issue {
77-
body
78-
comments (first: 100) {
79-
nodes {
80-
author {
81-
login
82-
}
83-
}
79+
author {
80+
login
8481
}
82+
body
8583
}
8684
}
85+
pageInfo {
86+
hasNextPage
87+
endCursor
88+
}
8789
}
8890
}
8991
"""
9092
formatted_start_date = start_date.strftime("%Y-%m-%dT%H:%M:%S")
9193
variables = {
92-
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access"
94+
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access,infra:commit-access-request"
9395
}
9496

95-
res_header, res_data = gh._Github__requester.graphql_query(
96-
query=query, variables=variables
97-
)
98-
data = res_data["data"]
97+
has_next_page = True
9998
users = []
100-
for issue in data["search"]["nodes"]:
101-
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
102-
99+
while has_next_page:
100+
res_header, res_data = gh._Github__requester.graphql_query(
101+
query=query, variables=variables
102+
)
103+
data = res_data["data"]
104+
for issue in data["search"]["nodes"]:
105+
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
106+
if issue["author"]:
107+
users.append(issue["author"]["login"])
108+
has_next_page = data["search"]["pageInfo"]["hasNextPage"]
109+
if has_next_page:
110+
variables["after"] = data["search"]["pageInfo"]["endCursor"]
103111
return users
104112

105113

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Install clang-format
6161
uses: aminya/setup-cpp@v1
6262
with:
63-
clangformat: 18.1.7
63+
clangformat: 19.1.6
6464

6565
- name: Setup Python env
6666
uses: actions/setup-python@v5

bolt/lib/Core/BinaryEmitter.cpp

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ BreakFunctionNames("break-funcs",
4747
cl::cat(BoltCategory));
4848

4949
static cl::list<std::string>
50-
FunctionPadSpec("pad-funcs",
51-
cl::CommaSeparated,
52-
cl::desc("list of functions to pad with amount of bytes"),
53-
cl::value_desc("func1:pad1,func2:pad2,func3:pad3,..."),
54-
cl::Hidden,
55-
cl::cat(BoltCategory));
50+
FunctionPadSpec("pad-funcs", cl::CommaSeparated,
51+
cl::desc("list of functions to pad with amount of bytes"),
52+
cl::value_desc("func1:pad1,func2:pad2,func3:pad3,..."),
53+
cl::Hidden, cl::cat(BoltCategory));
54+
55+
static cl::list<std::string> FunctionPadBeforeSpec(
56+
"pad-funcs-before", cl::CommaSeparated,
57+
cl::desc("list of functions to pad with amount of bytes"),
58+
cl::value_desc("func1:pad1,func2:pad2,func3:pad3,..."), cl::Hidden,
59+
cl::cat(BoltCategory));
5660

5761
static cl::opt<bool> MarkFuncs(
5862
"mark-funcs",
@@ -70,11 +74,11 @@ X86AlignBranchBoundaryHotOnly("x86-align-branch-boundary-hot-only",
7074
cl::init(true),
7175
cl::cat(BoltOptCategory));
7276

73-
size_t padFunction(const BinaryFunction &Function) {
74-
static std::map<std::string, size_t> FunctionPadding;
75-
76-
if (FunctionPadding.empty() && !FunctionPadSpec.empty()) {
77-
for (std::string &Spec : FunctionPadSpec) {
77+
size_t padFunction(std::map<std::string, size_t> &FunctionPadding,
78+
const cl::list<std::string> &Spec,
79+
const BinaryFunction &Function) {
80+
if (FunctionPadding.empty() && !Spec.empty()) {
81+
for (const std::string &Spec : Spec) {
7882
size_t N = Spec.find(':');
7983
if (N == std::string::npos)
8084
continue;
@@ -94,6 +98,15 @@ size_t padFunction(const BinaryFunction &Function) {
9498
return 0;
9599
}
96100

101+
size_t padFunctionBefore(const BinaryFunction &Function) {
102+
static std::map<std::string, size_t> CacheFunctionPadding;
103+
return padFunction(CacheFunctionPadding, FunctionPadBeforeSpec, Function);
104+
}
105+
size_t padFunctionAfter(const BinaryFunction &Function) {
106+
static std::map<std::string, size_t> CacheFunctionPadding;
107+
return padFunction(CacheFunctionPadding, FunctionPadSpec, Function);
108+
}
109+
97110
} // namespace opts
98111

99112
namespace {
@@ -319,6 +332,31 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
319332
Streamer.emitCodeAlignment(Function.getAlign(), &*BC.STI);
320333
}
321334

335+
if (size_t Padding = opts::padFunctionBefore(Function)) {
336+
// Handle padFuncsBefore after the above alignment logic but before
337+
// symbol addresses are decided.
338+
if (!BC.HasRelocations) {
339+
BC.errs() << "BOLT-ERROR: -pad-before-funcs is not supported in "
340+
<< "non-relocation mode\n";
341+
exit(1);
342+
}
343+
344+
// Preserve Function.getMinAlign().
345+
if (!isAligned(Function.getMinAlign(), Padding)) {
346+
BC.errs() << "BOLT-ERROR: user-requested " << Padding
347+
<< " padding bytes before function " << Function
348+
<< " is not a multiple of the minimum function alignment ("
349+
<< Function.getMinAlign().value() << ").\n";
350+
exit(1);
351+
}
352+
353+
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: padding before function " << Function
354+
<< " with " << Padding << " bytes\n");
355+
356+
// Since the padding is not executed, it can be null bytes.
357+
Streamer.emitFill(Padding, 0);
358+
}
359+
322360
MCContext &Context = Streamer.getContext();
323361
const MCAsmInfo *MAI = Context.getAsmInfo();
324362

@@ -373,7 +411,7 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
373411
emitFunctionBody(Function, FF, /*EmitCodeOnly=*/false);
374412

375413
// Emit padding if requested.
376-
if (size_t Padding = opts::padFunction(Function)) {
414+
if (size_t Padding = opts::padFunctionAfter(Function)) {
377415
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: padding function " << Function << " with "
378416
<< Padding << " bytes\n");
379417
Streamer.emitFill(Padding, MAI->getTextAlignFillValue());

bolt/lib/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ add_llvm_library(LLVMBOLTCore
3535
ParallelUtilities.cpp
3636
Relocation.cpp
3737

38+
NO_EXPORT
3839
DISABLE_LLVM_LINK_LLVM_DYLIB
3940
LINK_LIBS
4041
${LLVM_PTHREAD_LIB}

bolt/lib/Passes/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ add_llvm_library(LLVMBOLTPasses
4646
VeneerElimination.cpp
4747
RetpolineInsertion.cpp
4848

49+
NO_EXPORT
4950
DISABLE_LLVM_LINK_LLVM_DYLIB
5051

5152
LINK_LIBS

bolt/lib/Passes/ReorderFunctions.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ extern cl::OptionCategory BoltOptCategory;
2828
extern cl::opt<unsigned> Verbosity;
2929
extern cl::opt<uint32_t> RandomSeed;
3030

31-
extern size_t padFunction(const bolt::BinaryFunction &Function);
31+
extern size_t padFunctionBefore(const bolt::BinaryFunction &Function);
32+
extern size_t padFunctionAfter(const bolt::BinaryFunction &Function);
3233

3334
extern cl::opt<bolt::ReorderFunctions::ReorderType> ReorderFunctions;
3435
cl::opt<bolt::ReorderFunctions::ReorderType> ReorderFunctions(
@@ -304,8 +305,10 @@ Error ReorderFunctions::runOnFunctions(BinaryContext &BC) {
304305
return false;
305306
if (B->isIgnored())
306307
return true;
307-
const size_t PadA = opts::padFunction(*A);
308-
const size_t PadB = opts::padFunction(*B);
308+
const size_t PadA = opts::padFunctionBefore(*A) +
309+
opts::padFunctionAfter(*A);
310+
const size_t PadB = opts::padFunctionBefore(*B) +
311+
opts::padFunctionAfter(*B);
309312
if (!PadA || !PadB) {
310313
if (PadA)
311314
return true;

bolt/lib/Profile/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ add_llvm_library(LLVMBOLTProfile
77
YAMLProfileReader.cpp
88
YAMLProfileWriter.cpp
99

10+
NO_EXPORT
1011
DISABLE_LLVM_LINK_LLVM_DYLIB
1112

1213
LINK_COMPONENTS

bolt/lib/Rewrite/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ add_llvm_library(LLVMBOLTRewrite
2525
RewriteInstance.cpp
2626
SDTRewriter.cpp
2727

28+
NO_EXPORT
2829
DISABLE_LLVM_LINK_LLVM_DYLIB
2930

3031
LINK_LIBS

bolt/lib/RuntimeLibs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_llvm_library(LLVMBOLTRuntimeLibs
1111
HugifyRuntimeLibrary.cpp
1212
InstrumentationRuntimeLibrary.cpp
1313

14+
NO_EXPORT
1415
DISABLE_LLVM_LINK_LLVM_DYLIB
1516
)
1617

bolt/lib/Target/AArch64/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ endif()
1919
add_llvm_library(LLVMBOLTTargetAArch64
2020
AArch64MCPlusBuilder.cpp
2121

22+
NO_EXPORT
2223
DISABLE_LLVM_LINK_LLVM_DYLIB
2324

2425
DEPENDS

0 commit comments

Comments
 (0)