Skip to content

Commit 479c785

Browse files
Merge branch 'sycl-web' of https://github.com/otcshare/llvm into pulldown-ww26
2 parents 90aaba8 + 1a42fca commit 479c785

File tree

3,111 files changed

+189885
-44071
lines changed

Some content is hidden

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

3,111 files changed

+189885
-44071
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ d8f0e6caa91e230a486c948ab643174e40bdf215
4343

4444
# Use C++11 default member initializers in LLDB. NFC.
4545
9494c510af56d9c8593ab69017dcaa232210b235
46+
47+
# [libc++][NFC] clang-format <__config>
48+
ac251726f84d5b7e6533a2e3712920184435b61b

.github/workflows/closed-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
steps:
1111
- uses: andymckay/labeler@1.0.4
1212
with:
13-
remove-labels: "awaiting-review"
13+
remove-labels: 'awaiting-review'

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# /cherry-pick <commit> <...>
55
#
66
# This comment will attempt to cherry-pick the given commits to the latest
7-
# release branch (release/Y.x) and if successful push the result to a branch
7+
# release branch (release/Y.x) and if successful, push the result to a branch
88
# on github.
99
#
1010
# /branch <owner>/<repo>/<branch>
@@ -31,9 +31,9 @@ jobs:
3131
name: Backport Commits
3232
runs-on: ubuntu-20.04
3333
if: >-
34-
(github.repository == 'llvm/llvm-project') &&
35-
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
36-
contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
34+
(github.repository == 'llvm/llvm-project') &&
35+
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
36+
contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
3737
steps:
3838
- name: Fetch LLVM sources
3939
uses: actions/checkout@v2
@@ -64,16 +64,16 @@ jobs:
6464
name: Create Pull Request
6565
runs-on: ubuntu-20.04
6666
if: >-
67-
(github.repository == 'llvm/llvm-project') &&
68-
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
69-
contains(github.event.comment.body, '/branch')
67+
(github.repository == 'llvm/llvm-project') &&
68+
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
69+
contains(github.event.comment.body, '/branch')
7070
7171
steps:
7272
- name: Fetch LLVM sources
7373
uses: actions/checkout@v2
7474

7575
- name: Setup Environment
76-
run: |
76+
run: |
7777
pip install -r ./llvm/utils/git/requirements.txt
7878
7979
- name: Create Pull Request

.github/workflows/issue-subscriber.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: github.repository == 'llvm/llvm-project'
1212
steps:
13-
- name: Setup Automation Script
14-
run: |
15-
curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/github-automation.py
16-
curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/requirements.txt
17-
chmod a+x github-automation.py
18-
pip install -r requirements.txt
13+
- name: Setup Automation Script
14+
run: |
15+
curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/github-automation.py
16+
curl -O -L https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_SHA/llvm/utils/git/requirements.txt
17+
chmod a+x github-automation.py
18+
pip install -r requirements.txt
1919
20-
- name: Update watchers
21-
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
22-
env:
23-
LABEL_NAME: ${{ github.event.label.name }}
24-
run: |
25-
./github-automation.py \
26-
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \
27-
issue-subscriber \
28-
--issue-number '${{ github.event.issue.number }}' \
29-
--label-name "$LABEL_NAME"
20+
- name: Update watchers
21+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
22+
env:
23+
LABEL_NAME: ${{ github.event.label.name }}
24+
run: |
25+
./github-automation.py \
26+
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \
27+
issue-subscriber \
28+
--issue-number '${{ github.event.issue.number }}' \
29+
--label-name "$LABEL_NAME"

.github/workflows/llvm-bugs.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ jobs:
1919
MAILGUN_API_KEY: ${{ secrets.LLVM_BUGS_KEY }}
2020
with:
2121
script: |
22-
const Mailgun = require("mailgun.js");
22+
const Mailgun = require('mailgun.js');
2323
const formData = require('form-data');
24-
const mailgun = new Mailgun(formData);
2524
26-
const DOMAIN = "email.llvm.org";
25+
const mailgun = new Mailgun(formData);
26+
const DOMAIN = 'email.llvm.org';
2727
28-
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY});
28+
const mg = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY });
2929
3030
github.rest.issues.get({
3131
issue_number: context.issue.number,
3232
owner: context.repo.owner,
33-
repo: context.repo.repo,
33+
repo: context.repo.repo
3434
})
35-
.then(function(issue) {
35+
.then((issue) => {
3636
const payload = {
3737
author : issue.data.user.login,
3838
issue : issue.data.number,
3939
title : issue.data.title,
4040
url : issue.data.html_url,
41-
labels : issue.data.labels.map(label => { return label.name }),
42-
assignee : issue.data.assignees.map(assignee => { return assignee.login }),
41+
labels : issue.data.labels.map((label) => label.name),
42+
assignee : issue.data.assignees.map((assignee) => assignee.login),
4343
body : issue.data.body
4444
};
45-
45+
4646
const data = {
47-
from: "LLVM Bugs <llvm-bugs@email.llvm.org>",
48-
to: "llvm-bugs@lists.llvm.org",
47+
from: 'LLVM Bugs <llvm-bugs@email.llvm.org>',
48+
to: 'llvm-bugs@lists.llvm.org',
4949
subject: `[Bug ${issue.data.number}] ${issue.data.title}`,
50-
template: "new-github-issue",
50+
template: 'new-github-issue',
5151
'o:tracking-clicks': 'no',
5252
'h:X-Mailgun-Variables': JSON.stringify(payload)
5353
};
5454
55-
return mg.messages.create(DOMAIN, data)
55+
return mg.messages.create(DOMAIN, data);
5656
})
57-
.then(msg => console.log(msg));
57+
.then((msg) => console.log(msg));

.github/workflows/new-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ jobs:
1010
steps:
1111
- uses: andymckay/labeler@1.0.4
1212
with:
13-
add-labels: "new issue"
13+
add-labels: 'new issue'
1414
ignore-if-labeled: true

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class BinaryContext {
239239
Optional<DWARFUnit *> getDWOCU(uint64_t DWOId);
240240

241241
/// Returns DWOContext if it exists.
242-
DWARFContext *getDWOContext();
242+
DWARFContext *getDWOContext() const;
243243

244244
/// Get Number of DWOCUs in a map.
245245
uint32_t getNumDWOCUs() { return DWOCUs.size(); }

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,20 @@ class BinaryFunction {
842842
return (RI == Relocations.end()) ? nullptr : &RI->second;
843843
}
844844

845+
/// Return the first relocation in the function that starts at an address in
846+
/// the [StartOffset, EndOffset) range. Return nullptr if no such relocation
847+
/// exists.
848+
const Relocation *getRelocationInRange(uint64_t StartOffset,
849+
uint64_t EndOffset) const {
850+
assert(CurrentState == State::Empty &&
851+
"Relocations unavailable in the current function state.");
852+
auto RI = Relocations.lower_bound(StartOffset);
853+
if (RI != Relocations.end() && RI->first < EndOffset)
854+
return &RI->second;
855+
856+
return nullptr;
857+
}
858+
845859
/// Returns the raw binary encoding of this function.
846860
ErrorOr<ArrayRef<uint8_t>> getData() const;
847861

@@ -968,6 +982,15 @@ class BinaryFunction {
968982
return const_cast<BinaryFunction *>(this)->getInstructionAtOffset(Offset);
969983
}
970984

985+
/// Return offset for the first instruction. If there is data at the
986+
/// beginning of a function then offset of the first instruction could
987+
/// be different from 0
988+
uint64_t getFirstInstructionOffset() const {
989+
if (Instructions.empty())
990+
return 0;
991+
return Instructions.begin()->first;
992+
}
993+
971994
/// Return jump table that covers a given \p Address in memory.
972995
JumpTable *getJumpTableContainingAddress(uint64_t Address) {
973996
auto JTI = JumpTables.upper_bound(Address);
@@ -1314,11 +1337,11 @@ class BinaryFunction {
13141337
case ELF::R_X86_64_PC8:
13151338
case ELF::R_X86_64_PC32:
13161339
case ELF::R_X86_64_PC64:
1340+
case ELF::R_X86_64_GOTPCRELX:
1341+
case ELF::R_X86_64_REX_GOTPCRELX:
13171342
Relocations[Offset] = Relocation{Offset, Symbol, RelType, Addend, Value};
13181343
return;
13191344
case ELF::R_X86_64_PLT32:
1320-
case ELF::R_X86_64_GOTPCRELX:
1321-
case ELF::R_X86_64_REX_GOTPCRELX:
13221345
case ELF::R_X86_64_GOTPCREL:
13231346
case ELF::R_X86_64_TPOFF32:
13241347
case ELF::R_X86_64_GOTTPOFF:

bolt/include/bolt/Core/Relocation.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ struct Relocation {
5555
/// Return size of this relocation.
5656
size_t getSize() const { return getSizeForType(Type); }
5757

58-
/// Handle special cases when relocation should not be processed by bolt
58+
/// Skip relocations that we don't want to handle in BOLT
59+
static bool skipRelocationType(uint64_t Type);
60+
61+
/// Handle special cases when relocation should not be processed by BOLT
5962
static bool skipRelocationProcess(uint64_t Type, uint64_t Contents);
6063

6164
// Adjust value depending on relocation type (make it PC relative or not)
@@ -77,6 +80,9 @@ struct Relocation {
7780
/// Return true if relocation type implies the creation of a GOT entry
7881
static bool isGOT(uint64_t Type);
7982

83+
/// Special relocation type that allows the linker to modify the instruction.
84+
static bool isX86GOTPCRELX(uint64_t Type);
85+
8086
/// Return true if relocation type is NONE
8187
static bool isNone(uint64_t Type);
8288

bolt/lib/Core/BinaryBasicBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void BinaryBasicBlock::dump() const {
563563
if (Label)
564564
outs() << Label->getName() << ":\n";
565565
BC.printInstructions(outs(), Instructions.begin(), Instructions.end(),
566-
getOffset());
566+
getOffset(), Function);
567567
outs() << "preds:";
568568
for (auto itr = pred_begin(); itr != pred_end(); ++itr) {
569569
outs() << " " << (*itr)->getName();

0 commit comments

Comments
 (0)