Skip to content

Commit 343171d

Browse files
authored
Merge branch 'main' into lldb-dap-logs
2 parents cc40fb3 + a55221d commit 343171d

File tree

1,014 files changed

+86058
-65668
lines changed

Some content is hidden

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

1,014 files changed

+86058
-65668
lines changed

.ci/generate_test_report_lib.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
6262
# aligned with the failure.
6363
failing_action = ninja_log[index].split("FAILED: ")[1]
6464
failure_log = []
65+
66+
# Parse the lines above the FAILED: string if the line does not come
67+
# immediately after a progress indicator to ensure that we capture the
68+
# entire failure message.
69+
if not ninja_log[index - 1].startswith("["):
70+
before_index = index - 1
71+
while before_index > 0 and not ninja_log[before_index].startswith("["):
72+
failure_log.append(ninja_log[before_index])
73+
before_index = before_index - 1
74+
failure_log.reverse()
75+
76+
# Parse the failure information, which comes after the FAILED: tag.
6577
while (
6678
index < len(ninja_log)
6779
and not ninja_log[index].startswith("[")

.ci/generate_test_report_lib_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def test_ninja_log_mismatched_failed(self):
181181
"tools/check-langley",
182182
dedent(
183183
"""\
184+
ModuleNotFoundError: No module named 'mount_langley'
184185
FAILED: tools/check-langley
185186
Wow! This system is really broken!"""
186187
),

.github/CODEOWNERS

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp @nikic
2929
/llvm/lib/Transforms/InstCombine/ @nikic
3030

31+
# AMDGPU buffer pointer lowerings
32+
/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp @krzysz00
33+
3134
/clang/test/CXX/drs/ @Endilll
3235
/clang/www/cxx_dr_status.html @Endilll
3336
/clang/www/make_cxx_dr_status @Endilll
@@ -93,9 +96,9 @@
9396
/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp @MaheshRavishankar @nicolasvasilache
9497
/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp @dcaballe @MaheshRavishankar @nicolasvasilache
9598
/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp @MaheshRavishankar @nicolasvasilache
96-
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @hanhanW @nicolasvasilache
97-
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @hanhanW @nicolasvasilache
98-
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @hanhanW @nicolasvasilache @Groverkss
99+
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @nicolasvasilache
100+
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @nicolasvasilache
101+
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @nicolasvasilache @Groverkss
99102

100103
# MemRef Dialect in MLIR.
101104
/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
@@ -112,16 +115,16 @@
112115
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
113116
/mlir/include/mlir/Dialect/Vector/IR @kuhar
114117
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
115-
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @hanhanW @nicolasvasilache
118+
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @nicolasvasilache
116119
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @banach-space @dcaballe @MaheshRavishankar @nicolasvasilache
117-
/mlir/**/*EmulateNarrowType* @dcaballe @hanhanW
120+
/mlir/**/*EmulateNarrowType* @dcaballe
118121

119122
# Presburger library in MLIR
120123
/mlir/**/*Presburger* @Groverkss @Superty
121124

122125
# Tensor Dialect in MLIR.
123-
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @hanhanW @nicolasvasilache
124-
/mlir/lib/Dialect/Tensor/Transforms/* @hanhanW @nicolasvasilache
126+
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @nicolasvasilache
127+
/mlir/lib/Dialect/Tensor/Transforms/* @nicolasvasilache
125128

126129
# Transform Dialect in MLIR.
127130
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache @rolfmorel

.github/workflows/issue-write.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ jobs:
162162
if: >-
163163
always() &&
164164
steps.download-artifact.outputs.artifact-ids != ''
165-
run: cat comments
165+
run: cat comments*

.github/workflows/premerge.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
fetch-depth: 2
6464
- name: Build and Test
6565
timeout-minutes: 120
66-
continue-on-error: ${{ runner.arch == 'ARM64' }}
6766
env:
6867
GITHUB_TOKEN: ${{ github.token }}
6968
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ intended audience is BOLT developers. The document is an updated version of the
1010
in assembly, or `OpNegateRAState` in BOLT sources. In this document, I will use
1111
**negate-ra-state** as a shorthand.
1212

13+
Note: there are two resolutions for CFI:
14+
- Call Frame Instruction: individual DWARF instruction, e.g. negate-ra-state
15+
- Control Flow Integrity: a security mechanism, e.g. pointer authentication.
16+
1317
## Introduction
1418

1519
### Pointer Authentication
@@ -104,9 +108,9 @@ negate-ra-state CFIs will become invalid during BasicBlock reordering.
104108
## Solution design
105109

106110
The implementation introduces two new passes:
107-
1. `MarkRAStatesPass`: assigns the RA state to each instruction based on the CFIs
108-
in the input binary
109-
2. `InsertNegateRAStatePass`: reads those assigned instruction RA states after
111+
1. `PointerAuthCFIAnalyzer`: assigns the RA state to each instruction based on
112+
the CFIs in the input binary
113+
2. `PointerAuthCFIFixup`: reads those assigned instruction RA states after
110114
optimizations, and emits `DW_CFA_AARCH64_negate_ra_state` CFIs at the correct
111115
places: wherever there is a state change between two consecutive instructions
112116
in the layout order.
@@ -129,7 +133,7 @@ instruction.
129133
This special case is handled by adding an `initialRAState` bool to each BinaryFunction.
130134
If the `Offset` the CFI refers to is zero, we don't store an annotation, but set
131135
the `initialRAState` in `FillCFIInfoFor`. This information is then used in
132-
`MarkRAStates`.
136+
`PointerAuthCFIAnalyzer`.
133137

134138
### Binaries without DWARF info
135139

@@ -146,7 +150,7 @@ In summary:
146150
- pointer auth is used, and we have DWARF CFIs: passes run, and rewrite the
147151
negate-ra-state CFI.
148152

149-
### MarkRAStates pass
153+
### PointerAuthCFIAnalyzer pass
150154

151155
This pass runs before optimizations reorder anything.
152156

@@ -173,9 +177,9 @@ what we have before the pass, and after it.
173177
| autiasp | negate-ra-state | signed |
174178
| ret | | unsigned |
175179

176-
##### Error handling in MarkRAState Pass:
180+
##### Error handling in PointerAuthCFIAnalyzer pass:
177181

178-
Whenever the MarkRAStates pass finds inconsistencies in the current
182+
Whenever the PointerAuthCFIAnalyzer pass finds inconsistencies in the current
179183
BinaryFunction, it marks the function as ignored using `BF.setIgnored()`. BOLT
180184
will not optimize this function but will emit it unchanged in the original section
181185
(`.bolt.org.text`).
@@ -188,16 +192,17 @@ The inconsistencies are as follows:
188192
Users will be informed about the number of ignored functions in the pass, the
189193
exact functions ignored, and the found inconsistency.
190194

191-
### InsertNegateRAStatePass
195+
### PointerAuthCFIFixup
192196

193-
This pass runs after optimizations. It performns the _inverse_ of MarkRAState pa s:
197+
This pass runs after optimizations. It performs the _inverse_ of PointerAuthCFIAnalyzer
198+
pass:
194199
1. it reads the RA state annotations attached to the instructions, and
195200
2. whenever the state changes, it adds a PseudoInstruction that holds an
196201
OpNegateRAState CFI.
197202

198203
##### Covering newly generated instructions:
199204

200-
Some BOLT passes can add new Instructions. In InsertNegateRAStatePass, we have
205+
Some BOLT passes can add new Instructions. In PointerAuthCFIFixup, we have
201206
to know what RA state these have.
202207

203208
> [!important]
@@ -224,7 +229,7 @@ freely. The only special case is function splitting. When a function is split,
224229
the split part becomes a new function in the emitted binary. For unwinding to
225230
work, it needs to "replay" all CFIs that lead up to the split point. BOLT does
226231
this for other CFIs. As negate-ra-state is not read (only stored as an Annotation),
227-
we have to do this manually in InsertNegateRAStatePass. Here, if the split part
232+
we have to do this manually in PointerAuthCFIFixup. Here, if the split part
228233
starts with an instruction that has Signed RA state, we add a negate-ra-state CFI
229234
to indicate this.
230235

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ class BinaryContext {
11131113
return FragmentClasses.isEquivalent(LHS, RHS);
11141114
}
11151115

1116-
/// Add interprocedural reference for \p Function to \p Address
1116+
/// Add interprocedural branch reference from \p Function to \p Address.
11171117
void addInterproceduralReference(BinaryFunction *Function, uint64_t Address) {
11181118
InterproceduralReferences.push_back({Function, Address});
11191119
}
@@ -1128,7 +1128,8 @@ class BinaryContext {
11281128
/// argument is false.
11291129
bool handleAArch64Veneer(uint64_t Address, bool MatchOnly = false);
11301130

1131-
/// Resolve inter-procedural dependencies from
1131+
/// Resolve inter-procedural branch dependencies discovered during
1132+
/// disassembly.
11321133
void processInterproceduralReferences();
11331134

11341135
/// Skip functions with all parent and child fragments transitively.

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,6 @@ class MCPlusBuilder {
538538
llvm_unreachable("not implemented");
539539
}
540540

541-
virtual void createDirectBranch(MCInst &Inst, const MCSymbol *Target,
542-
MCContext *Ctx) {
543-
llvm_unreachable("not implemented");
544-
}
545-
546541
virtual MCPhysReg getX86R11() const { llvm_unreachable("not implemented"); }
547542

548543
virtual unsigned getShortBranchOpcode(unsigned Opcode) const {

bolt/include/bolt/Passes/IdenticalCodeFolding.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,19 @@ class IdenticalCodeFolding : public BinaryFunctionPass {
3737
Error runOnFunctions(BinaryContext &BC) override;
3838

3939
private:
40+
static constexpr uint64_t VTableAddressGranularity = 4;
41+
4042
/// Bit vector of memory addresses of vtables.
4143
llvm::SparseBitVector<> VTableBitVector;
4244

4345
/// Return true if the memory address is in a vtable.
4446
bool isAddressInVTable(uint64_t Address) const {
45-
return VTableBitVector.test(Address / 8);
47+
return VTableBitVector.test(Address / VTableAddressGranularity);
4648
}
4749

4850
/// Mark memory address of a vtable as used.
4951
void setAddressUsedInVTable(uint64_t Address) {
50-
VTableBitVector.set(Address / 8);
52+
VTableBitVector.set(Address / VTableAddressGranularity);
5153
}
5254

5355
/// Scan symbol table and mark memory addresses of

bolt/include/bolt/Passes/MarkRAStates.h renamed to bolt/include/bolt/Passes/PointerAuthCFIAnalyzer.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
//===- bolt/Passes/MarkRAStates.cpp ---------------------------------===//
1+
//===- bolt/Passes/PointerAuthCFIAnalyzer.h -------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file implements the MarkRAStates class.
9+
// This file implements the PointerAuthCFIAnalyzer class.
1010
//
1111
//===----------------------------------------------------------------------===//
12-
#ifndef BOLT_PASSES_MARK_RA_STATES
13-
#define BOLT_PASSES_MARK_RA_STATES
12+
#ifndef BOLT_PASSES_POINTER_AUTH_CFI_ANALYZER
13+
#define BOLT_PASSES_POINTER_AUTH_CFI_ANALYZER
1414

1515
#include "bolt/Passes/BinaryPasses.h"
1616
#include <mutex>
1717

1818
namespace llvm {
1919
namespace bolt {
2020

21-
class MarkRAStates : public BinaryFunctionPass {
21+
class PointerAuthCFIAnalyzer : public BinaryFunctionPass {
2222
// setIgnored() is not thread-safe, but the pass is running on functions in
2323
// parallel.
2424
std::mutex IgnoreMutex;
2525

2626
public:
27-
explicit MarkRAStates() : BinaryFunctionPass(false) {}
27+
explicit PointerAuthCFIAnalyzer(const cl::opt<bool> &PrintPass)
28+
: BinaryFunctionPass(PrintPass) {}
2829

29-
const char *getName() const override { return "mark-ra-states"; }
30+
const char *getName() const override { return "pointer-auth-cfi-analyzer"; }
3031

3132
/// Pass entry point
3233
Error runOnFunctions(BinaryContext &BC) override;

0 commit comments

Comments
 (0)