Skip to content

Commit eb8afd2

Browse files
authored
Merge branch 'llvm:main' into main-inline-asm-fix-fp-int-move
2 parents ea6ac87 + 864beb1 commit eb8afd2

File tree

6,829 files changed

+427090
-306059
lines changed

Some content is hidden

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

6,829 files changed

+427090
-306059
lines changed

.github/new-issues-labeler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
'libc++':
1111
- '/libc[+x]{2}(?!\-)/i'
1212

13-
'libc++-abi':
14-
- '/libc[+x]{2}-abi/i'
13+
'libc++abi':
14+
- '/libc[+x]{2}-?abi/i'
1515

1616
'libc':
1717
- '/\blibc(?![-+])\b/i'

.github/new-prs-labeler.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ lld:
4040
llvm-lit:
4141
- llvm/utils/lit/**/*
4242

43-
mlir:afine:
44-
- mlir/**/Affine/**/*
45-
46-
mlir:python:
47-
- mlir/python/**/*
48-
49-
mlir:vectorops:
50-
- mlir/**/Vector/**/*
51-
5243
PGO:
5344
- llvm/lib/Transforms/Instrumentation/CGProfile.cpp
5445
- llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -90,6 +81,10 @@ compiler-rt:sanitizer:
9081
- compiler-rt/lib/scudo/**
9182
- compiler-rt/test/scudo/**
9283

84+
compiler-rt:scudo:
85+
- compiler-rt/lib/scudo/**
86+
- compiler-rt/test/scudo/**
87+
9388
xray:
9489
- llvm/tools/llvm-xray/**
9590
- compiler-rt/*/xray/**
@@ -259,6 +254,15 @@ mlir:vector:
259254
mlir:execution-engine:
260255
- mlir/**/ExecutionEngine/**
261256

257+
mlir:presburger:
258+
- mlir/**/*Presburger*/**
259+
260+
mlir:python:
261+
- mlir/python/**/*
262+
263+
mlir:vectorops:
264+
- mlir/**/Vector/**/*
265+
262266
coroutines:
263267
- clang/docs/DebuggingCoroutines.rst
264268
- clang/lib/Sema/SemaCoroutine.cpp
@@ -305,10 +309,6 @@ tools:llvm-mca:
305309
- llvm/include/llvm/MCA/**
306310
- llvm/lib/MCA/**
307311

308-
vectorizers:
309-
- llvm/lib/Transforms/Vectorize/**
310-
- llvm/include/llvm/Transforms/Vectorize/**
311-
312312
clang:
313313
- any:
314314
- clang/**
@@ -633,9 +633,6 @@ llvm:regalloc:
633633
- llvm/include/llvm/CodeGen/Spiller.h
634634
- llvm/**/*RegAlloc
635635

636-
mlir:presburger:
637-
- mlir/**/*Presburger
638-
639636
lldb:
640637
- lldb/**
641638

.github/workflows/issue-release-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
if: >-
7171
(github.repository == 'llvm/llvm-project') &&
7272
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
73-
contains(github.event.comment.body, '/branch')
73+
contains(github.event.comment.body, '/branch ')
7474
7575
steps:
7676
- name: Fetch LLVM sources

.github/workflows/llvm-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,17 @@ jobs:
170170
uses: actions/download-artifact@v3
171171
with:
172172
name: build-baseline
173+
path: build-baseline
173174
- name: Download latest
174175
uses: actions/download-artifact@v3
175176
with:
176177
name: build-latest
178+
path: build-latest
177179
- name: Download symbol list
178180
uses: actions/download-artifact@v3
179181
with:
180182
name: symbol-list
183+
path: symbol-list
181184

182185
- name: Install abi-compliance-checker
183186
run: sudo apt-get install abi-compliance-checker

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Check code formatting"
2+
on: pull_request_target
3+
permissions:
4+
pull-requests: write
5+
6+
jobs:
7+
code_formatter:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Fetch LLVM sources
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 2
14+
15+
- name: Get changed files
16+
id: changed-files
17+
uses: tj-actions/changed-files@v39
18+
with:
19+
separator: ","
20+
fetch_depth: 100 # Fetches only the last 10 commits
21+
22+
- name: "Listed files"
23+
run: |
24+
echo "Formatting files:"
25+
echo "${{ steps.changed-files.outputs.all_changed_files }}"
26+
27+
- name: Install clang-format
28+
uses: aminya/setup-cpp@v1
29+
with:
30+
clangformat: 17.0.1
31+
32+
- name: Setup Python env
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: '3.11'
36+
cache: 'pip'
37+
cache-dependency-path: 'llvm/utils/git/requirements_formatting.txt'
38+
39+
- name: Install python dependencies
40+
run: pip install -r llvm/utils/git/requirements_formatting.txt
41+
42+
- name: Run code formatter
43+
env:
44+
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
45+
START_REV: ${{ github.event.pull_request.base.sha }}
46+
END_REV: ${{ github.event.pull_request.head.sha }}
47+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
48+
run: |
49+
python llvm/utils/git/code-format-helper.py \
50+
--token ${{ secrets.GITHUB_TOKEN }} \
51+
--issue-number $GITHUB_PR_NUMBER \
52+
--start-rev $START_REV \
53+
--end-rev $END_REV \
54+
--changed-files "$CHANGED_FILES"

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

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/pr-receive.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
name: PR Receive
44
on:
55
pull_request_target:
6+
types:
7+
- opened
8+
- reopened
9+
- ready_for_review
10+
- synchronize
611

712
permissions:
813
contents: read
@@ -15,6 +20,7 @@ jobs:
1520
# to rebase. We want to ignore these pull requests to avoid excessive
1621
# notifications.
1722
if: github.repository == 'llvm/llvm-project' &&
23+
github.event.pull_request.draft == false &&
1824
github.event.pull_request.commits < 10
1925
steps:
2026
- name: Store PR Information

.github/workflows/release-tasks.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@ jobs:
2424
release_version=$(echo "${{ github.ref_name }}" | sed 's/llvmorg-//g')
2525
echo "release-version=$release_version" >> "$GITHUB_OUTPUT"
2626
27+
- name: Checkout LLVM
28+
uses: actions/checkout@v4
29+
2730
- name: Install Dependencies
2831
run: |
2932
sudo apt-get update
3033
sudo apt-get install -y \
3134
doxygen \
3235
graphviz \
3336
python3-github \
34-
python3-recommonmark \
35-
python3-sphinx \
3637
ninja-build \
3738
texlive-font-utils
38-
pip3 install --user sphinx-markdown-tables
39-
40-
- name: Checkout LLVM
41-
uses: actions/checkout@v4
39+
pip3 install --user -r ./llvm/docs/requirements.txt
4240
4341
- name: Create Release
4442
run: |
@@ -83,13 +81,24 @@ jobs:
8381
- name: Checkout LLVM
8482
uses: actions/checkout@v4
8583

84+
- name: Setup Cpp
85+
uses: aminya/setup-cpp@v1
86+
with:
87+
compiler: llvm-16.0.6
88+
cmake: true
89+
ninja: true
90+
8691
- name: Install dependencies
87-
run: sudo apt-get install -y python3-setuptools
92+
run: |
93+
sudo apt-get update
94+
sudo apt-get install -y python3-setuptools python3-psutil
8895
8996
- name: Test lit
9097
run: |
91-
cd llvm/utils/lit
92-
python3 lit.py tests
98+
mkdir build && cd build
99+
export FILECHECK_OPTS='-dump-input-filter=all -vv -color'
100+
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -G Ninja
101+
ninja -v -j $(nproc) check-lit
93102
94103
- name: Package lit
95104
run: |

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,15 @@ class BinaryContext {
871871
return nullptr;
872872
}
873873

874+
/// Retrieves a reference to ELF's _GLOBAL_OFFSET_TABLE_ symbol, which points
875+
/// at GOT, or null if it is not present in the input binary symtab.
876+
BinaryData *getGOTSymbol();
877+
878+
/// Checks if symbol name refers to ELF's _GLOBAL_OFFSET_TABLE_ symbol
879+
bool isGOTSymbol(StringRef SymName) const {
880+
return SymName == "_GLOBAL_OFFSET_TABLE_";
881+
}
882+
874883
/// Return true if \p SymbolName was generated internally and was not present
875884
/// in the input binary.
876885
bool isInternalSymbolName(const StringRef Name) {

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/Support/Allocator.h"
3030
#include "llvm/Support/ErrorHandling.h"
3131
#include "llvm/Support/ErrorOr.h"
32+
#include "llvm/Support/RWMutex.h"
3233
#include <cassert>
3334
#include <cstdint>
3435
#include <map>
@@ -166,10 +167,15 @@ class MCPlusBuilder {
166167
/// Names of non-standard annotations.
167168
SmallVector<std::string, 8> AnnotationNames;
168169

170+
/// A mutex that is used to control parallel accesses to
171+
/// AnnotationNameIndexMap and AnnotationsNames.
172+
mutable llvm::sys::RWMutex AnnotationNameMutex;
173+
169174
/// Allocate the TailCall annotation value. Clients of the target-specific
170175
/// MCPlusBuilder classes must use convert/lower/create* interfaces instead.
171176
void setTailCall(MCInst &Inst);
172177

178+
public:
173179
/// Transfer annotations from \p SrcInst to \p DstInst.
174180
void moveAnnotations(MCInst &&SrcInst, MCInst &DstInst) const {
175181
assert(!getAnnotationInst(DstInst) &&
@@ -182,7 +188,6 @@ class MCPlusBuilder {
182188
removeAnnotationInst(SrcInst);
183189
}
184190

185-
public:
186191
/// Return iterator range covering def operands.
187192
iterator_range<MCInst::iterator> defOperands(MCInst &Inst) const {
188193
return make_range(Inst.begin(),
@@ -621,6 +626,11 @@ class MCPlusBuilder {
621626
return Info->get(Inst.getOpcode()).mayStore();
622627
}
623628

629+
virtual bool isAArch64Exclusive(const MCInst &Inst) const {
630+
llvm_unreachable("not implemented");
631+
return false;
632+
}
633+
624634
virtual bool isCleanRegXOR(const MCInst &Inst) const {
625635
llvm_unreachable("not implemented");
626636
return false;
@@ -1775,6 +1785,7 @@ class MCPlusBuilder {
17751785

17761786
/// Return annotation index matching the \p Name.
17771787
std::optional<unsigned> getAnnotationIndex(StringRef Name) const {
1788+
std::shared_lock<llvm::sys::RWMutex> Lock(AnnotationNameMutex);
17781789
auto AI = AnnotationNameIndexMap.find(Name);
17791790
if (AI != AnnotationNameIndexMap.end())
17801791
return AI->second;
@@ -1784,10 +1795,10 @@ class MCPlusBuilder {
17841795
/// Return annotation index matching the \p Name. Create a new index if the
17851796
/// \p Name wasn't registered previously.
17861797
unsigned getOrCreateAnnotationIndex(StringRef Name) {
1787-
auto AI = AnnotationNameIndexMap.find(Name);
1788-
if (AI != AnnotationNameIndexMap.end())
1789-
return AI->second;
1798+
if (std::optional<unsigned> Index = getAnnotationIndex(Name))
1799+
return *Index;
17901800

1801+
std::unique_lock<llvm::sys::RWMutex> Lock(AnnotationNameMutex);
17911802
const unsigned Index =
17921803
AnnotationNameIndexMap.size() + MCPlus::MCAnnotation::kGeneric;
17931804
AnnotationNameIndexMap.insert(std::make_pair(Name, Index));

bolt/include/bolt/Core/Relocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ struct Relocation {
8484

8585
/// Special relocation type that allows the linker to modify the instruction.
8686
static bool isX86GOTPCRELX(uint64_t Type);
87+
static bool isX86GOTPC64(uint64_t Type);
8788

8889
/// Return true if relocation type is NONE
8990
static bool isNone(uint64_t Type);

bolt/lib/Core/BinaryContext.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,31 @@ BinaryContext::getBinaryDataContainingAddressImpl(uint64_t Address) const {
10261026
return nullptr;
10271027
}
10281028

1029+
BinaryData *BinaryContext::getGOTSymbol() {
1030+
// First tries to find a global symbol with that name
1031+
BinaryData *GOTSymBD = getBinaryDataByName("_GLOBAL_OFFSET_TABLE_");
1032+
if (GOTSymBD)
1033+
return GOTSymBD;
1034+
1035+
// This symbol might be hidden from run-time link, so fetch the local
1036+
// definition if available.
1037+
GOTSymBD = getBinaryDataByName("_GLOBAL_OFFSET_TABLE_/1");
1038+
if (!GOTSymBD)
1039+
return nullptr;
1040+
1041+
// If the local symbol is not unique, fail
1042+
unsigned Index = 2;
1043+
SmallString<30> Storage;
1044+
while (const BinaryData *BD =
1045+
getBinaryDataByName(Twine("_GLOBAL_OFFSET_TABLE_/")
1046+
.concat(Twine(Index++))
1047+
.toStringRef(Storage)))
1048+
if (BD->getAddress() != GOTSymBD->getAddress())
1049+
return nullptr;
1050+
1051+
return GOTSymBD;
1052+
}
1053+
10291054
bool BinaryContext::setBinaryDataSize(uint64_t Address, uint64_t Size) {
10301055
auto NI = BinaryDataMap.find(Address);
10311056
assert(NI != BinaryDataMap.end());

0 commit comments

Comments
 (0)