Skip to content

Commit d2a70a9

Browse files
committed
merge main into amd-stg-open
Change-Id: I2b6b23ae955e457168b5d628443830b860e1ba53
2 parents c222fb5 + cd60229 commit d2a70a9

File tree

985 files changed

+25210
-7660
lines changed

Some content is hidden

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

985 files changed

+25210
-7660
lines changed

.github/workflows/docs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- 'lld/docs/**'
2424
- 'openmp/docs/**'
2525
- 'polly/docs/**'
26+
- 'flang/docs/**'
2627
pull_request:
2728
paths:
2829
- 'llvm/docs/**'
@@ -35,11 +36,13 @@ on:
3536
- 'lld/docs/**'
3637
- 'openmp/docs/**'
3738
- 'polly/docs/**'
39+
- 'flang/docs/**'
3840

3941
jobs:
4042
check-docs-build:
4143
name: "Test documentation build"
4244
runs-on: ubuntu-latest
45+
if: github.repository == 'llvm/llvm-project'
4346
steps:
4447
# Don't fetch before checking for file changes to force the file changes
4548
# action to use the Github API in pull requests. If it's a push to a
@@ -75,6 +78,8 @@ jobs:
7578
- 'openmp/docs/**'
7679
polly:
7780
- 'polly/docs/**'
81+
flang:
82+
- 'flang/docs/**'
7883
- name: Fetch LLVM sources (PR)
7984
if: ${{ github.event_name == 'pull_request' }}
8085
uses: actions/checkout@v4
@@ -143,4 +148,11 @@ jobs:
143148
run: |
144149
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
145150
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
151+
- name: Build Flang docs
152+
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
153+
# TODO(boomanaiden154): Remove the SPHINX_WARNINGS_AS_ERRORS from the
154+
# CMake invocation once the warnings in the flang docs build are fixed.
155+
run: |
156+
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF ./llvm
157+
TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man
146158

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ permissions:
66
jobs:
77
code_formatter:
88
runs-on: ubuntu-latest
9+
if: github.repository == 'llvm/llvm-project'
910
steps:
1011
- name: Fetch LLVM sources
1112
uses: actions/checkout@v4

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,11 @@ class RewriteInstance {
509509
};
510510

511511
/// AArch64 PLT sections.
512-
const PLTSectionInfo AArch64_PLTSections[3] = {
513-
{".plt"}, {".iplt"}, {nullptr}};
512+
const PLTSectionInfo AArch64_PLTSections[4] = {
513+
{".plt"}, {".plt.got"}, {".iplt"}, {nullptr}};
514514

515515
/// RISCV PLT sections.
516-
const PLTSectionInfo RISCV_PLTSections[3] = {{".plt"}, {nullptr}};
516+
const PLTSectionInfo RISCV_PLTSections[2] = {{".plt"}, {nullptr}};
517517

518518
/// Return PLT information for a section with \p SectionName or nullptr
519519
/// if the section is not PLT.

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,14 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
862862
/// add x16, x16, #0xbe0
863863
/// br x17
864864
///
865+
/// The other type of trampolines are located in .plt.got, that are used for
866+
/// non-lazy bindings so doesn't use x16 arg to transfer .got entry address:
867+
///
868+
/// adrp x16, 230000
869+
/// ldr x17, [x16, #3040]
870+
/// br x17
871+
/// nop
872+
///
865873
uint64_t analyzePLTEntry(MCInst &Instruction, InstructionIterator Begin,
866874
InstructionIterator End,
867875
uint64_t BeginPC) const override {

bolt/test/AArch64/Inputs/plt-got.yaml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
--- !ELF
2+
FileHeader:
3+
Class: ELFCLASS64
4+
Data: ELFDATA2LSB
5+
Type: ET_DYN
6+
Machine: EM_AARCH64
7+
Entry: 0x10360
8+
ProgramHeaders:
9+
- Type: PT_PHDR
10+
Flags: [ PF_R ]
11+
VAddr: 0x40
12+
Align: 0x8
13+
Offset: 0x40
14+
- Type: PT_INTERP
15+
Flags: [ PF_R ]
16+
FirstSec: .interp
17+
LastSec: .interp
18+
VAddr: 0x270
19+
Offset: 0x270
20+
- Type: PT_LOAD
21+
Flags: [ PF_R ]
22+
FirstSec: .interp
23+
LastSec: .rela.dyn
24+
Align: 0x10000
25+
Offset: 0x0
26+
- Type: PT_LOAD
27+
Flags: [ PF_X, PF_R ]
28+
FirstSec: .plt.got
29+
LastSec: .text
30+
VAddr: 0x10350
31+
Align: 0x10000
32+
Offset: 0x2e0
33+
- Type: PT_LOAD
34+
Flags: [ PF_W, PF_R ]
35+
FirstSec: .interp
36+
LastSec: .got
37+
VAddr: 0x203B0
38+
Align: 0x10000
39+
Offset: 0x270
40+
- Type: PT_LOAD
41+
Flags: [ PF_W, PF_R ]
42+
FirstSec: .got.plt
43+
LastSec: .got.plt
44+
VAddr: 0x304E0
45+
Align: 0x10000
46+
Offset: 0x420
47+
- Type: PT_DYNAMIC
48+
Flags: [ PF_W, PF_R ]
49+
FirstSec: .dynamic
50+
LastSec: .dynamic
51+
VAddr: 0x203B0
52+
Align: 0x8
53+
Offset: 0x340
54+
- Type: PT_GNU_STACK
55+
Flags: [ PF_W, PF_R ]
56+
Offset: 0x0
57+
Sections:
58+
- Name: .interp
59+
Type: SHT_PROGBITS
60+
Flags: [ SHF_ALLOC ]
61+
Address: 0x270
62+
AddressAlign: 0x1
63+
Offset: 0x270
64+
Content: 2F6C69622F6C642D6C696E75782D616172636836342E736F2E3100
65+
- Name: .dynsym
66+
Type: SHT_DYNSYM
67+
Flags: [ SHF_ALLOC ]
68+
Address: 0x2B0
69+
Link: .dynstr
70+
AddressAlign: 0x8
71+
- Name: .dynstr
72+
Type: SHT_STRTAB
73+
Flags: [ SHF_ALLOC ]
74+
Address: 0x2E0
75+
AddressAlign: 0x1
76+
- Name: .rela.dyn
77+
Type: SHT_RELA
78+
Flags: [ SHF_ALLOC ]
79+
Address: 0x2F0
80+
Link: .dynsym
81+
AddressAlign: 0x8
82+
Relocations:
83+
- Offset: 0x204D8
84+
Symbol: abort
85+
Type: R_AARCH64_GLOB_DAT
86+
- Name: .plt.got
87+
Type: SHT_PROGBITS
88+
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
89+
Address: 0x10350
90+
AddressAlign: 0x10
91+
Content: 90000090116E42F920021FD61F2003D5
92+
- Name: .text
93+
Type: SHT_PROGBITS
94+
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
95+
Address: 0x10360
96+
AddressAlign: 0x4
97+
Content: FF8300D1FD7B01A9FD43009188000090086D42F9E80700F9E80740F9080100F1E8179F1AA800003701000014E80740F900013FD601000014EEFFFF97007D20D41000009010420D9100021FD61F2003D5
98+
- Name: .dynamic
99+
Type: SHT_DYNAMIC
100+
Flags: [ SHF_WRITE, SHF_ALLOC ]
101+
Address: 0x203B0
102+
Link: .dynstr
103+
AddressAlign: 0x8
104+
Entries:
105+
- Tag: DT_NEEDED
106+
Value: 0x1
107+
- Tag: DT_RELA
108+
Value: 0x2F0
109+
- Tag: DT_RELASZ
110+
Value: 0x18
111+
- Tag: DT_RELAENT
112+
Value: 0x18
113+
- Tag: DT_PLTGOT
114+
Value: 0x304E0
115+
- Tag: DT_SYMTAB
116+
Value: 0x2B0
117+
- Tag: DT_SYMENT
118+
Value: 0x18
119+
- Tag: DT_STRTAB
120+
Value: 0x2E0
121+
- Tag: DT_STRSZ
122+
Value: 0x10
123+
- Tag: DT_GNU_HASH
124+
Value: 0x290
125+
- Tag: DT_FLAGS_1
126+
Value: 0x8000000
127+
- Tag: DT_DEBUG
128+
Value: 0x0
129+
- Tag: DT_NULL
130+
Value: 0x0
131+
- Name: .got
132+
Type: SHT_PROGBITS
133+
Flags: [ SHF_WRITE, SHF_ALLOC ]
134+
Address: 0x204D0
135+
AddressAlign: 0x8
136+
Content: '00000000000000000000000000000000'
137+
- Name: .got.plt
138+
Type: SHT_PROGBITS
139+
Flags: [ SHF_WRITE, SHF_ALLOC ]
140+
Address: 0x304E0
141+
AddressAlign: 0x8
142+
Content: B00302000000000000000000000000000000000000000000
143+
- Name: .rela.text
144+
Type: SHT_RELA
145+
Flags: [ SHF_INFO_LINK ]
146+
Link: .symtab
147+
AddressAlign: 0x8
148+
Offset: 0x1268
149+
Info: .text
150+
Relocations:
151+
- Offset: 0x1036C
152+
Symbol: abort
153+
Type: R_AARCH64_ADR_GOT_PAGE
154+
- Offset: 0x10370
155+
Symbol: abort
156+
Type: R_AARCH64_LD64_GOT_LO12_NC
157+
- Offset: 0x10398
158+
Symbol: abort
159+
Type: R_AARCH64_CALL26
160+
- Type: SectionHeaderTable
161+
Sections:
162+
- Name: .interp
163+
- Name: .dynsym
164+
- Name: .dynstr
165+
- Name: .rela.dyn
166+
- Name: .plt.got
167+
- Name: .text
168+
- Name: .dynamic
169+
- Name: .got
170+
- Name: .got.plt
171+
- Name: .strtab
172+
- Name: .symtab
173+
- Name: .shstrtab
174+
- Name: .rela.text
175+
Symbols:
176+
- Name: .text
177+
Type: STT_SECTION
178+
Section: .text
179+
Value: 0x10360
180+
- Name: .dynamic
181+
Type: STT_SECTION
182+
Section: .dynamic
183+
Value: 0x203B0
184+
- Name: .got
185+
Type: STT_SECTION
186+
Section: .got
187+
Value: 0x204D0
188+
- Name: .got.plt
189+
Type: STT_SECTION
190+
Section: .got.plt
191+
Value: 0x304E0
192+
- Name: 'abort$got'
193+
Type: STT_OBJECT
194+
Section: .got
195+
Value: 0x204D8
196+
- Name: _start
197+
Type: STT_FUNC
198+
Section: .text
199+
Value: 0x10360
200+
Size: 0x3C
201+
- Name: _DYNAMIC
202+
Section: .dynamic
203+
Value: 0x203B0
204+
- Name: _GLOBAL_OFFSET_TABLE_
205+
Section: .got
206+
Value: 0x204D0
207+
- Name: abort
208+
Type: STT_FUNC
209+
Binding: STB_GLOBAL
210+
Size: 0x8
211+
DynamicSymbols:
212+
- Name: abort
213+
Type: STT_FUNC
214+
Binding: STB_GLOBAL
215+
Size: 0x8
216+
...

bolt/test/AArch64/plt-got.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This test checks .plt.got handling by BOLT
2+
3+
RUN: yaml2obj %p/Inputs/plt-got.yaml &> %t.exe
4+
RUN: llvm-bolt %t.exe -o %t.bolt --print-disasm --print-only=_start/1 | \
5+
RUN: FileCheck %s
6+
7+
CHECK: bl abort@PLT

clang-tools-extra/clang-doc/BitcodeReader.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,17 @@ llvm::Error decodeRecord(const Record &R, AccessSpecifier &Field,
6767

6868
llvm::Error decodeRecord(const Record &R, TagTypeKind &Field,
6969
llvm::StringRef Blob) {
70-
switch (R[0]) {
71-
case TTK_Struct:
72-
case TTK_Interface:
73-
case TTK_Union:
74-
case TTK_Class:
75-
case TTK_Enum:
76-
Field = (TagTypeKind)R[0];
70+
switch (static_cast<TagTypeKind>(R[0])) {
71+
case TagTypeKind::Struct:
72+
case TagTypeKind::Interface:
73+
case TagTypeKind::Union:
74+
case TagTypeKind::Class:
75+
case TagTypeKind::Enum:
76+
Field = static_cast<TagTypeKind>(R[0]);
7777
return llvm::Error::success();
78-
default:
79-
return llvm::createStringError(llvm::inconvertibleErrorCode(),
80-
"invalid value for TagTypeKind");
8178
}
79+
return llvm::createStringError(llvm::inconvertibleErrorCode(),
80+
"invalid value for TagTypeKind");
8281
}
8382

8483
llvm::Error decodeRecord(const Record &R, std::optional<Location> &Field,

clang-tools-extra/clang-doc/BitcodeWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ void ClangDocBitcodeWriter::emitBlock(const RecordInfo &I) {
551551
emitRecord(*I.DefLoc, RECORD_DEFLOCATION);
552552
for (const auto &L : I.Loc)
553553
emitRecord(L, RECORD_LOCATION);
554-
emitRecord(I.TagType, RECORD_TAG_TYPE);
554+
emitRecord(llvm::to_underlying(I.TagType), RECORD_TAG_TYPE);
555555
emitRecord(I.IsTypeDef, RECORD_IS_TYPE_DEF);
556556
for (const auto &N : I.Members)
557557
emitBlock(N);
@@ -578,7 +578,7 @@ void ClangDocBitcodeWriter::emitBlock(const BaseRecordInfo &I) {
578578
emitRecord(I.USR, BASE_RECORD_USR);
579579
emitRecord(I.Name, BASE_RECORD_NAME);
580580
emitRecord(I.Path, BASE_RECORD_PATH);
581-
emitRecord(I.TagType, BASE_RECORD_TAG_TYPE);
581+
emitRecord(llvm::to_underlying(I.TagType), BASE_RECORD_TAG_TYPE);
582582
emitRecord(I.IsVirtual, BASE_RECORD_IS_VIRTUAL);
583583
emitRecord(I.Access, BASE_RECORD_ACCESS);
584584
emitRecord(I.IsParent, BASE_RECORD_IS_PARENT);

clang-tools-extra/clang-doc/Generators.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ findGeneratorByName(llvm::StringRef Format) {
2828

2929
std::string getTagType(TagTypeKind AS) {
3030
switch (AS) {
31-
case TagTypeKind::TTK_Class:
31+
case TagTypeKind::Class:
3232
return "class";
33-
case TagTypeKind::TTK_Union:
33+
case TagTypeKind::Union:
3434
return "union";
35-
case TagTypeKind::TTK_Interface:
35+
case TagTypeKind::Interface:
3636
return "interface";
37-
case TagTypeKind::TTK_Struct:
37+
case TagTypeKind::Struct:
3838
return "struct";
39-
case TagTypeKind::TTK_Enum:
39+
case TagTypeKind::Enum:
4040
return "enum";
4141
}
4242
llvm_unreachable("Unknown TagTypeKind");

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ RecordInfo::RecordInfo(SymbolID USR, StringRef Name, StringRef Path)
239239

240240
void RecordInfo::merge(RecordInfo &&Other) {
241241
assert(mergeable(Other));
242-
if (!TagType)
242+
if (!llvm::to_underlying(TagType))
243243
TagType = Other.TagType;
244244
IsTypeDef = IsTypeDef || Other.IsTypeDef;
245245
if (Members.empty())

clang-tools-extra/clang-doc/Representation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ struct RecordInfo : public SymbolInfo {
350350
void merge(RecordInfo &&I);
351351

352352
// Type of this record (struct, class, union, interface).
353-
TagTypeKind TagType = TagTypeKind::TTK_Struct;
353+
TagTypeKind TagType = TagTypeKind::Struct;
354354

355355
// Full qualified name of this record, including namespaces and template
356356
// specializations.

0 commit comments

Comments
 (0)