Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
29cfef1
[PDB][NativeSession] Use better error code for invalid format (#167885)
MuellerMP Nov 24, 2025
2bdd135
[libc++] Optimize num_get integral functions (#121795)
philnik777 Nov 24, 2025
bb78728
Reland "RegisterCoalescer: Add implicit-def of super register when co…
sdesmalen-arm Nov 24, 2025
ccd2c3e
Revert "[libcxx][ci] Temporarily disable ARM jobs" (#169352)
DavidSpickett Nov 24, 2025
e442c67
[clangd] Fix C++20 build failure
hokein Nov 24, 2025
dc39fa3
[OpenACC][CIR] copyout clause lowering on func-local declare (#169350)
erichkeane Nov 24, 2025
870f581
[libc++] Disable header deprecations until #168041 is landed (#169305)
philnik777 Nov 24, 2025
ab71452
[Support] Permit "default" string in AllocToken mode parsing (#169351)
melver Nov 24, 2025
f31e1cf
[libsycl] Add Maintainers.md file (#168550)
KseniyaTikhomirova Nov 24, 2025
51fef12
[lldb] Add const& to InstructionList parameter (#169342)
felipepiovezan Nov 24, 2025
cc0371f
[AMDGPU] Use ListSeparator. NFC. (#169347)
jayfoad Nov 24, 2025
e3d0ac1
[libc++][string_view] Applied `[[nodiscard]]` (#169010)
H-G-Hristov Nov 24, 2025
78d8298
[OpenACC][CIR] 'create' clause lowering on func-local-declare (#169356)
erichkeane Nov 24, 2025
bab1c29
[BOLT] Extend Inliner to work on functions with Pointer Authenticatio…
bgergely0 Nov 24, 2025
23907a2
[BPF] Allow libcalls behind a feature gate (#168442)
LucasSte Nov 24, 2025
38a5dd5
Fix typo in LLVM Kaleidoscope tutorial (Chapter 2) (#169319)
baramatsubonzo Nov 24, 2025
ad1be4a
[CIR] Add handling for static data members (#169134)
andykaylor Nov 24, 2025
76e9834
[MLIR][LLVM] Support named barrier as a global variable type in llvm …
PMylon Nov 24, 2025
79c56e8
Add support for llvm.dbg.declare_value in the CoroSplitter pass. (#16…
rastogishubham Nov 24, 2025
c1f24a5
[windows] improve python3.dll load check (#168864)
charles-zablit Nov 24, 2025
3843a50
[Clang][TypePrinter] Make printNestedNameSpecifier look at typedefs (…
boomanaiden154 Nov 24, 2025
81f4ab8
[clang-doc] Add Mustache HTML output to namespace test (#169107)
evelez7 Nov 24, 2025
37f7b31
Reland [VPlan] Handle WidenGEP in narrowToSingleScalars (#167880)
artagnon Nov 24, 2025
9688f88
[LV] Pre-commit test for #128062 (#164801)
artagnon Nov 24, 2025
621cbcd
[mlir][acc] Adds attr to acc.present to identify default clause origi…
atmnp Nov 24, 2025
a27bb38
Reapply "[NFC][bugpoint] Namespace cleanup in `bugpoint`" (#168961) (…
jurahul Nov 24, 2025
1b65752
[OpenACC][CIR] Implement 'present' lowering on local-declare (#169381)
erichkeane Nov 24, 2025
740d0bd
[MLIR][Python] add GetTypeID for llvm.struct_type and llvm.ptr and en…
makslevental Nov 24, 2025
d4cd331
[gn build] Port 2bdd1357c826
llvmgnsyncbot Nov 24, 2025
0e86510
[gn build] Port 3773bbe9e791
llvmgnsyncbot Nov 24, 2025
40fb2ca
[gn build] Port 645e0dcbff33
llvmgnsyncbot Nov 24, 2025
4459564
[clang][Sema] Handle target_clones redeclarations that omit the attri…
henrybw Nov 24, 2025
f5e228b
[DirectX] Simplify DXIL data scalarization, and data scalarize whole …
Icohedron Nov 24, 2025
4a0d485
[clang-doc] Add definition information to class templates (#169109)
evelez7 Nov 24, 2025
658675f
[OpenACC][CIR] 'device_resident' clause lowering for local declare (#…
erichkeane Nov 24, 2025
0549aa1
[llvm][dsymutil] Use the DW_AT_name of the uniqued DIE for insertion …
Michael137 Nov 24, 2025
e92bb83
[AArch64][PAC] Simplify emission of authenticated pointer check (NFC)…
atrosinenko Nov 24, 2025
c2de9b2
merge main into amd-staging
ronlieb Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bolt/include/bolt/Core/MCPlusBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,12 @@ class MCPlusBuilder {
return false;
}

/// Generate the matching pointer authentication instruction from a fused
/// pauth-and-return instruction.
virtual void createMatchingAuth(const MCInst &AuthAndRet, MCInst &Auth) {
llvm_unreachable("not implemented");
}

/// Returns the register used as a return address. Returns std::nullopt if
/// not applicable, such as reading the return address from a system register
/// or from the stack.
Expand Down
19 changes: 19 additions & 0 deletions bolt/lib/Passes/Inliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ InliningInfo getInliningInfo(const BinaryFunction &BF) {
if (BC.MIB->isPush(Inst) || BC.MIB->isPop(Inst))
continue;

// Pointer signing and authenticatin instructions are used around
// Push and Pop. These are also straightforward to handle.
if (BC.isAArch64() &&
(BC.MIB->isPSignOnLR(Inst) || BC.MIB->isPAuthOnLR(Inst) ||
BC.MIB->isPAuthAndRet(Inst)))
continue;

DirectSP |= BC.MIB->hasDefOfPhysReg(Inst, SPReg) ||
BC.MIB->hasUseOfPhysReg(Inst, SPReg);
}
Expand Down Expand Up @@ -338,6 +345,18 @@ Inliner::inlineCall(BinaryBasicBlock &CallerBB,
BC.Ctx.get());
}

// Handling fused authentication and return instructions (Armv8.3-A):
// if the Callee does not end in a tailcall, the return will be removed
// from the inlined block. If that return is RETA(A|B), we have to keep
// the authentication part.
// RETAA -> AUTIASP
// RETAB -> AUTIBSP
if (!CSIsTailCall && BC.isAArch64() && BC.MIB->isPAuthAndRet(Inst)) {
MCInst Auth;
BC.MIB->createMatchingAuth(Inst, Auth);
InsertII =
std::next(InlinedBB->insertInstruction(InsertII, std::move(Auth)));
}
if (CSIsTailCall || (!MIB.isCall(Inst) && !MIB.isReturn(Inst))) {
InsertII =
std::next(InlinedBB->insertInstruction(InsertII, std::move(Inst)));
Expand Down
27 changes: 27 additions & 0 deletions bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,33 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
Inst.getOpcode() == AArch64::RETABSPPCr;
}

void createMatchingAuth(const MCInst &AuthAndRet, MCInst &Auth) override {
Auth.clear();
Auth.setOperands(AuthAndRet.getOperands());
switch (AuthAndRet.getOpcode()) {
case AArch64::RETAA:
Auth.setOpcode(AArch64::AUTIASP);
break;
case AArch64::RETAB:
Auth.setOpcode(AArch64::AUTIBSP);
break;
case AArch64::RETAASPPCi:
Auth.setOpcode(AArch64::AUTIASPPCi);
break;
case AArch64::RETABSPPCi:
Auth.setOpcode(AArch64::AUTIBSPPCi);
break;
case AArch64::RETAASPPCr:
Auth.setOpcode(AArch64::AUTIASPPCr);
break;
case AArch64::RETABSPPCr:
Auth.setOpcode(AArch64::AUTIBSPPCr);
break;
default:
llvm_unreachable("Unhandled fused pauth-and-return instruction");
}
}

std::optional<MCPhysReg> getSignedReg(const MCInst &Inst) const override {
switch (Inst.getOpcode()) {
case AArch64::PACIA:
Expand Down
45 changes: 45 additions & 0 deletions bolt/test/AArch64/inline-armv8.3-returns.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This test checks that inlining functions with fused pointer-auth-and-return
# instructions is properly handled by BOLT.

# REQUIRES: system-linux

# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown -mattr=+v8.3a %s -o %t.o
# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --inline-all --print-inline --print-only=_Z3barP1A \
# RUN: %t.exe -o %t.bolt | FileCheck %s

# CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 8 bytes.
# CHECK: Binary Function "_Z3barP1A" after inlining {
# CHECK-NOT: bl _Z3fooP1A
# CHECK: ldr x8, [x0]
# CHECK-NEXT: ldr w0, [x8]
# CHECK-NEXT: autiasp

.text
.globl _Z3fooP1A
.type _Z3fooP1A,@function
_Z3fooP1A:
paciasp
ldr x8, [x0]
ldr w0, [x8]
retaa
.size _Z3fooP1A, .-_Z3fooP1A

.globl _Z3barP1A
.type _Z3barP1A,@function
_Z3barP1A:
stp x29, x30, [sp, #-16]!
mov x29, sp
bl _Z3fooP1A
mul w0, w0, w0
ldp x29, x30, [sp], #16
ret
.size _Z3barP1A, .-_Z3barP1A

.globl main
.p2align 2
.type main,@function
main:
mov w0, wzr
ret
.size main, .-main
46 changes: 46 additions & 0 deletions bolt/test/AArch64/inline-armv8.3-tailcall.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This test checks that inlining functions with fused pointer-auth-and-return
# instructions into a location with a tailcall is properly handled by BOLT.
# Because _Z3barP1A ends in a tailcall, we don't remove the return instruction
# from the inlined block. Therefore, we should see a retaa, and not an autiasp.

# REQUIRES: system-linux

# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown -mattr=+v8.3a %s -o %t.o
# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --inline-all --print-inline --print-only=_Z3barP1A \
# RUN: %t.exe -o %t.bolt | FileCheck %s

# CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 12 bytes.
# CHECK: Binary Function "_Z3barP1A" after inlining {
# CHECK-NOT: bl _Z3fooP1A
# CHECK: mov x29, sp
# CHECK-NEXT: paciasp
# CHECK-NEXT: ldr x8, [x0]
# CHECK-NEXT: ldr w0, [x8]
# CHECK-NEXT: retaa

.text
.globl _Z3fooP1A
.type _Z3fooP1A,@function
_Z3fooP1A:
paciasp
ldr x8, [x0]
ldr w0, [x8]
retaa
.size _Z3fooP1A, .-_Z3fooP1A

.globl _Z3barP1A
.type _Z3barP1A,@function
_Z3barP1A:
stp x29, x30, [sp, #-16]!
mov x29, sp
b _Z3fooP1A // tailcall
.size _Z3barP1A, .-_Z3barP1A

.globl main
.p2align 2
.type main,@function
main:
mov w0, wzr
ret
.size main, .-main
61 changes: 61 additions & 0 deletions bolt/test/AArch64/inline-pauth-lr.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This test checks that inlining functions with the pauth-lr variants of
# fused pointer-auth-and-return instructions is properly handled by BOLT.

# REQUIRES: system-linux

# RUN: %clang %cflags -march=armv9.5-a+pauth-lr -O0 %s -o %t.exe -Wl,-q
# RUN: llvm-bolt --inline-all --print-inline --print-only=_Z3barP1A \
# RUN: %t.exe -o %t.bolt | FileCheck %s

# CHECK: BOLT-INFO: inlined 0 calls at 2 call sites in 2 iteration(s). Change in binary size: 16 bytes.
# CHECK: Binary Function "_Z3barP1A" after inlining {
# CHECK-NOT: bl _Z3fooP1A
# CHECK: paciasppc
# CHECK-NEXT: ldr x8, [x0]
# CHECK-NEXT: ldr w0, [x8]
# CHECK-NEXT: autiasppcr x28
# CHECK-NEXT: paciasppc
# CHECK-NEXT: ldr x7, [x0]
# CHECK-NEXT: ldr w0, [x7]
# CHECK-NEXT: autiasppc _Z3bazP1A

.text
.globl _Z3fooP1A
.type _Z3fooP1A,@function
_Z3fooP1A:
paciasppc
ldr x8, [x0]
ldr w0, [x8]
retaasppcr x28
.size _Z3fooP1A, .-_Z3fooP1A

.text
.globl _Z3bazP1A
.type _Z3bazP1A,@function
_Z3bazP1A:
0:
paciasppc
ldr x7, [x0]
ldr w0, [x7]
retaasppc 0b
.size _Z3bazP1A, .-_Z3bazP1A

.globl _Z3barP1A
.type _Z3barP1A,@function
_Z3barP1A:
stp x29, x30, [sp, #-16]!
mov x29, sp
bl _Z3fooP1A
bl _Z3bazP1A
mul w0, w0, w0
ldp x29, x30, [sp], #16
ret
.size _Z3barP1A, .-_Z3barP1A

.globl main
.p2align 2
.type main,@function
main:
mov w0, wzr
ret
.size main, .-main
1 change: 1 addition & 0 deletions clang-tools-extra/clang-doc/assets/class-template.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<section class="hero section-container">
<div class="hero__title">
<h1 class="hero__title-large">{{TagType}} {{Name}}</h1>
<p>Defined at line {{Location.LineNumber}} of file {{Location.Filename}}</p>
{{#Description}}
<div class="hero__subtitle">
{{>Comments}}
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/clangd/SemanticSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ class PragmaRegionFinder {
}

void operator()(const DirectiveTree::Conditional &C) {
// C.Branches needs to see the DirectiveTree definition, otherwise build
// fails in C++20.
[[maybe_unused]] DirectiveTree Dummy;
for (const auto &[_, SubTree] : C.Branches)
walk(SubTree);
}
Expand Down
Loading