Skip to content

Commit 0796990

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents 44cd046 + e3adf6b commit 0796990

File tree

529 files changed

+23730
-9709
lines changed

Some content is hidden

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

529 files changed

+23730
-9709
lines changed

.github/workflows/libclang-abi-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- name: Install abi-compliance-checker
105105
run: |
106106
sudo apt-get update
107-
sudo apt-get install abi-dumper autoconf pkg-config
107+
sudo apt-get install -y abi-dumper autoconf pkg-config
108108
- name: Install universal-ctags
109109
run: |
110110
git clone https://github.com/universal-ctags/ctags.git
@@ -157,7 +157,7 @@ jobs:
157157
- name: Install abi-compliance-checker
158158
run: |
159159
sudo apt-get update
160-
sudo apt-get install abi-compliance-checker
160+
sudo apt-get install -y abi-compliance-checker
161161
- name: Compare ABI
162162
run: |
163163
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do

.github/workflows/llvm-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Install abi-compliance-checker
9393
run: |
9494
sudo apt-get update
95-
sudo apt-get install abi-dumper autoconf pkg-config
95+
sudo apt-get -y install abi-dumper autoconf pkg-config
9696
- name: Install universal-ctags
9797
run: |
9898
git clone https://github.com/universal-ctags/ctags.git
@@ -166,7 +166,7 @@ jobs:
166166
- name: Install abi-compliance-checker
167167
run: |
168168
sudo apt-get update
169-
sudo apt-get install abi-compliance-checker
169+
sudo apt-get -y install abi-compliance-checker
170170
- name: Compare ABI
171171
run: |
172172
if [ -s symbol-list/llvm.symbols ]; then

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,11 @@ class MCPlusBuilder {
12661266

12671267
/// Return MCSymbol extracted from the expression.
12681268
virtual const MCSymbol *getTargetSymbol(const MCExpr *Expr) const {
1269-
if (auto *SymbolRefExpr = dyn_cast<const MCSymbolRefExpr>(Expr))
1269+
if (auto *BinaryExpr = dyn_cast<const MCBinaryExpr>(Expr))
1270+
return getTargetSymbol(BinaryExpr->getLHS());
1271+
1272+
auto *SymbolRefExpr = dyn_cast<const MCSymbolRefExpr>(Expr);
1273+
if (SymbolRefExpr && SymbolRefExpr->getKind() == MCSymbolRefExpr::VK_None)
12701274
return &SymbolRefExpr->getSymbol();
12711275

12721276
return nullptr;

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -862,20 +862,12 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
862862
if (AArchExpr && AArchExpr->getSubExpr())
863863
return getTargetSymbol(AArchExpr->getSubExpr());
864864

865-
auto *BinExpr = dyn_cast<MCBinaryExpr>(Expr);
866-
if (BinExpr)
867-
return getTargetSymbol(BinExpr->getLHS());
868-
869-
auto *SymExpr = dyn_cast<MCSymbolRefExpr>(Expr);
870-
if (SymExpr && SymExpr->getKind() == MCSymbolRefExpr::VK_None)
871-
return &SymExpr->getSymbol();
872-
873-
return nullptr;
865+
return MCPlusBuilder::getTargetSymbol(Expr);
874866
}
875867

876868
const MCSymbol *getTargetSymbol(const MCInst &Inst,
877869
unsigned OpNum = 0) const override {
878-
if (!getSymbolRefOperandNum(Inst, OpNum))
870+
if (!OpNum && !getSymbolRefOperandNum(Inst, OpNum))
879871
return nullptr;
880872

881873
const MCOperand &Op = Inst.getOperand(OpNum);

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -338,15 +338,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
338338
if (RISCVExpr && RISCVExpr->getSubExpr())
339339
return getTargetSymbol(RISCVExpr->getSubExpr());
340340

341-
auto *BinExpr = dyn_cast<MCBinaryExpr>(Expr);
342-
if (BinExpr)
343-
return getTargetSymbol(BinExpr->getLHS());
344-
345-
auto *SymExpr = dyn_cast<MCSymbolRefExpr>(Expr);
346-
if (SymExpr && SymExpr->getKind() == MCSymbolRefExpr::VK_None)
347-
return &SymExpr->getSymbol();
348-
349-
return nullptr;
341+
return MCPlusBuilder::getTargetSymbol(Expr);
350342
}
351343

352344
const MCSymbol *getTargetSymbol(const MCInst &Inst,

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,11 +1796,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
17961796
if (!Op.isExpr())
17971797
return nullptr;
17981798

1799-
auto *SymExpr = dyn_cast<MCSymbolRefExpr>(Op.getExpr());
1800-
if (!SymExpr || SymExpr->getKind() != MCSymbolRefExpr::VK_None)
1801-
return nullptr;
1802-
1803-
return &SymExpr->getSymbol();
1799+
return MCPlusBuilder::getTargetSymbol(Op.getExpr());
18041800
}
18051801

18061802
bool analyzeBranch(InstructionIterator Begin, InstructionIterator End,

bolt/test/X86/lite-mode-target-expr.s

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Check that llvm-bolt properly updates references in unoptimized code when
2+
## such references are non-trivial expressions.
3+
4+
# RUN: %clang %cflags %s -o %t.exe -Wl,-q -no-pie
5+
# RUN: llvm-bolt %t.exe -o %t.bolt --funcs=_start
6+
# RUN: llvm-objdump -d --disassemble-symbols=_start %t.bolt > %t.out
7+
# RUN: llvm-objdump -d --disassemble-symbols=cold %t.bolt >> %t.out
8+
# RUN: FileCheck %s < %t.out
9+
10+
## _start() will be optimized and assigned a new address.
11+
# CHECK: [[#%x,ADDR:]] <_start>:
12+
13+
## cold() is not optimized, but references to _start are updated.
14+
# CHECK-LABEL: <cold>:
15+
# CHECK-NEXT: movl $0x[[#ADDR - 1]], %ecx
16+
# CHECK-NEXT: movl $0x[[#ADDR]], %ecx
17+
# CHECK-NEXT: movl $0x[[#ADDR + 1]], %ecx
18+
19+
.text
20+
.globl cold
21+
.type cold, %function
22+
cold:
23+
movl $_start-1, %ecx
24+
movl $_start, %ecx
25+
movl $_start+1, %ecx
26+
ret
27+
.size cold, .-cold
28+
29+
.globl _start
30+
.type _start, %function
31+
_start:
32+
ret
33+
.size _start, .-_start

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,13 @@ Hexagon Support
413413
X86 Support
414414
^^^^^^^^^^^
415415

416-
- Disable ``-m[no-]avx10.1`` and switch ``-m[no-]avx10.2`` to alias of 512 bit
417-
options.
418-
- Change ``-mno-avx10.1-512`` to alias of ``-mno-avx10.1-256`` to disable both
419-
256 and 512 bit instructions.
416+
- The 256-bit maximum vector register size control was removed from
417+
`AVX10 whitepaper <https://cdrdv2.intel.com/v1/dl/getContent/784343>_`.
418+
* Re-target ``m[no-]avx10.1`` to enable AVX10.1 with 512-bit maximum vector register size.
419+
* Emit warning for ``mavx10.x-256``, noting AVX10/256 is not supported.
420+
* Emit warning for ``mavx10.x-512``, noting to use ``m[no-]avx10.x`` instead.
421+
* Emit warning for ``m[no-]evex512``, noting AVX10/256 is not supported.
422+
* The features avx10.x-256/512 keep unchanged and will be removed in the next release.
420423

421424
Arm and AArch64 Support
422425
^^^^^^^^^^^^^^^^^^^^^^^
@@ -434,6 +437,7 @@ Windows Support
434437
- Clang now can process the `i128` and `ui128` integeral suffixes when MSVC
435438
extensions are enabled. This allows for properly processing ``intsafe.h`` in
436439
the Windows SDK.
440+
- Clang now supports MSVC vector deleting destructors (GH19772).
437441

438442
LoongArch Support
439443
^^^^^^^^^^^^^^^^^

clang/include/clang/AST/VTableBuilder.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class VTableComponent {
150150

151151
bool isRTTIKind() const { return isRTTIKind(getKind()); }
152152

153-
GlobalDecl getGlobalDecl() const {
153+
GlobalDecl getGlobalDecl(bool HasVectorDeletingDtors) const {
154154
assert(isUsedFunctionPointerKind() &&
155155
"GlobalDecl can be created only from virtual function");
156156

@@ -161,7 +161,9 @@ class VTableComponent {
161161
case CK_CompleteDtorPointer:
162162
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Complete);
163163
case CK_DeletingDtorPointer:
164-
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Deleting);
164+
return GlobalDecl(DtorDecl, (HasVectorDeletingDtors)
165+
? CXXDtorType::Dtor_VectorDeleting
166+
: CXXDtorType::Dtor_Deleting);
165167
case CK_VCallOffset:
166168
case CK_VBaseOffset:
167169
case CK_OffsetToTop:

clang/include/clang/Basic/ABI.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ enum CXXCtorType {
3131

3232
/// C++ destructor types.
3333
enum CXXDtorType {
34-
Dtor_Deleting, ///< Deleting dtor
35-
Dtor_Complete, ///< Complete object dtor
36-
Dtor_Base, ///< Base object dtor
37-
Dtor_Comdat ///< The COMDAT used for dtors
34+
Dtor_Deleting, ///< Deleting dtor
35+
Dtor_Complete, ///< Complete object dtor
36+
Dtor_Base, ///< Base object dtor
37+
Dtor_Comdat, ///< The COMDAT used for dtors
38+
Dtor_VectorDeleting ///< Vector deleting dtor
3839
};
3940

4041
} // end namespace clang

0 commit comments

Comments
 (0)