Skip to content

Commit d1d8a45

Browse files
authored
LLVM and SPIRV-LLVM-Translator pulldown (WW07)
LLVM: llvm/llvm-project@1cee960 SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@a836197
2 parents 2ebcd8a + dbb02e9 commit d1d8a45

File tree

5,300 files changed

+145538
-92953
lines changed

Some content is hidden

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

5,300 files changed

+145538
-92953
lines changed

.clang-tidy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ CheckOptions:
66
value: CamelCase
77
- key: readability-identifier-naming.FunctionCase
88
value: camelBack
9+
# Exclude from scanning as this is an exported symbol used for fuzzing
10+
# throughout the code base.
11+
- key: readability-identifier-naming.FunctionIgnoredRegexp
12+
value: "LLVMFuzzerTestOneInput"
913
- key: readability-identifier-naming.MemberCase
1014
value: CamelCase
1115
- key: readability-identifier-naming.ParameterCase

.github/workflows/closed-issues.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Labeling closed issues
2+
on:
3+
issues:
4+
types: ['closed']
5+
6+
jobs:
7+
automate-issues-labels:
8+
runs-on: ubuntu-latest
9+
if: github.repository == 'llvm/llvm-project'
10+
steps:
11+
- uses: andymckay/labeler@1.0.4
12+
with:
13+
remove-labels: "awaiting-review"
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# This contains the workflow definitions that allow users to test backports
2+
# to the release branch using comments on issues.
3+
#
4+
# /cherry-pick <commit> <...>
5+
#
6+
# 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
8+
# on github.
9+
#
10+
# /branch <owner>/<repo>/<branch>
11+
#
12+
# This comment will create a pull request from <branch> to the latest release
13+
# branch.
14+
15+
name: Issue Release Workflow
16+
17+
on:
18+
issue_comment:
19+
types:
20+
- created
21+
- edited
22+
23+
env:
24+
COMMENT_BODY: ${{ github.event.comment.body }}
25+
26+
jobs:
27+
backport-commits:
28+
name: Backport Commits
29+
runs-on: ubuntu-20.04
30+
if: >-
31+
(github.repository == 'llvm/llvm-project') &&
32+
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
33+
contains(github.event.comment.body, '/cherry-pick')
34+
steps:
35+
- name: Fetch LLVM sources
36+
uses: actions/checkout@v2
37+
with:
38+
repository: llvm/llvm-project
39+
# GitHub stores the token used for checkout and uses it for pushes
40+
# too, but we want to use a different token for pushing, so we need
41+
# to disable persist-credentials here.
42+
persist-credentials: false
43+
fetch-depth: 0
44+
45+
- name: Setup Environment
46+
run: |
47+
pip install -r ./llvm/utils/git/requirements.txt
48+
./llvm/utils/git/github-automation.py --token ${{ github.token }} setup-llvmbot-git
49+
50+
- name: Backport Commits
51+
run: |
52+
printf "$COMMENT_BODY" |
53+
./llvm/utils/git/github-automation.py \
54+
--repo $GITHUB_REPOSITORY \
55+
--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
56+
release-workflow \
57+
--issue-number ${{ github.event.issue.number }} \
58+
auto
59+
60+
create-pull-request:
61+
name: Create Pull Request
62+
runs-on: ubuntu-20.04
63+
if: >-
64+
(github.repository == 'llvm/llvm-project') &&
65+
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
66+
contains(github.event.comment.body, '/branch')
67+
68+
steps:
69+
- name: Fetch LLVM sources
70+
uses: actions/checkout@v2
71+
72+
- name: Setup Environment
73+
run: |
74+
pip install -r ./llvm/utils/git/requirements.txt
75+
76+
- name: Create Pull Request
77+
run: |
78+
printf "$COMMENT_BODY" |
79+
./llvm/utils/git/github-automation.py \
80+
--repo $GITHUB_REPOSITORY \
81+
--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
82+
release-workflow \
83+
--issue-number ${{ github.event.issue.number }} \
84+
auto

.github/workflows/issue-subscriber.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ jobs:
1313
- name: Setup Automation Script
1414
run: |
1515
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
1617
chmod a+x github-automation.py
17-
pip install PyGithub
18+
pip install -r requirements.txt
1819
1920
- name: Update watchers
2021
run: |

bolt/include/bolt/Core/DebugData.h

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ struct DebugLineTableRowRef {
107107
/// Common buffer vector used for debug info handling.
108108
using DebugBufferVector = SmallVector<char, 16>;
109109

110+
/// Map of old CU offset to new offset and length.
111+
struct CUInfo {
112+
uint32_t Offset;
113+
uint32_t Length;
114+
};
115+
using CUOffsetMap = std::map<uint32_t, CUInfo>;
116+
110117
/// Serializes the .debug_ranges DWARF section.
111118
class DebugRangesSectionWriter {
112119
public:
@@ -155,9 +162,8 @@ class DebugARangesSectionWriter {
155162
/// Writes .debug_aranges with the added ranges to the MCObjectWriter.
156163
/// Takes in \p RangesStream to write into, and \p CUMap which maps CU
157164
/// original offsets to new ones.
158-
void
159-
writeARangesSection(raw_svector_ostream &RangesStream,
160-
const std::unordered_map<uint32_t, uint32_t> CUMap) const;
165+
void writeARangesSection(raw_svector_ostream &RangesStream,
166+
const CUOffsetMap &CUMap) const;
161167

162168
/// Resets the writer to a clear state.
163169
void reset() { CUAddressRanges.clear(); }
@@ -647,8 +653,8 @@ class DebugInfoBinaryPatcher : public SimpleBinaryPatcher {
647653
void setDWPOffset(uint64_t DWPOffset) { DWPUnitOffset = DWPOffset; }
648654

649655
/// When this function is invoked all of the DebugInfo Patches must be done.
650-
/// Returns a map of old CU offsets to new ones.
651-
std::unordered_map<uint32_t, uint32_t> computeNewOffsets();
656+
/// Returns a map of old CU offsets to new offsets and new sizes.
657+
CUOffsetMap computeNewOffsets(DWARFContext &DWCtx, bool IsDWOContext);
652658

653659
private:
654660
struct PatchDeleter {
@@ -685,7 +691,7 @@ class DebugInfoBinaryPatcher : public SimpleBinaryPatcher {
685691
using UniquePatchPtrType = std::unique_ptr<Patch, PatchDeleter>;
686692

687693
uint64_t DWPUnitOffset{0};
688-
uint32_t ChangeInSize{0};
694+
int32_t ChangeInSize{0};
689695
std::vector<UniquePatchPtrType> DebugPatches;
690696
/// Mutex used for parallel processing of debug info.
691697
std::mutex WriterMutex;
@@ -709,8 +715,11 @@ class DebugAbbrevWriter {
709715
std::unique_ptr<DebugBufferVector> Buffer;
710716
std::unique_ptr<raw_svector_ostream> Stream;
711717
};
712-
/// Map original unit abbrev offset to abbreviations data.
713-
std::map<uint64_t, AbbrevData> UnitsAbbrevData;
718+
/// Map original unit to abbreviations data.
719+
std::unordered_map<const DWARFUnit *, AbbrevData *> UnitsAbbrevData;
720+
721+
/// Map from Hash Signature to AbbrevData.
722+
llvm::StringMap<std::unique_ptr<AbbrevData>> AbbrevDataCache;
714723

715724
/// Attributes substitution (patch) information.
716725
struct PatchInfo {
@@ -777,10 +786,8 @@ class DebugAbbrevWriter {
777786
/// Return an offset in the finalized abbrev section corresponding to CU/TU.
778787
uint64_t getAbbreviationsOffsetForUnit(const DWARFUnit &Unit) {
779788
assert(!DWOId && "offsets are tracked for non-DWO units only");
780-
assert(UnitsAbbrevData.find(Unit.getAbbreviationsOffset()) !=
781-
UnitsAbbrevData.end() &&
782-
"no abbrev data found for unit");
783-
return UnitsAbbrevData[Unit.getAbbreviationsOffset()].Offset;
789+
assert(UnitsAbbrevData.count(&Unit) && "no abbrev data found for unit");
790+
return UnitsAbbrevData[&Unit]->Offset;
784791
}
785792
};
786793

bolt/include/bolt/Rewrite/DWARFRewriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ class DWARFRewriter {
9393
makeFinalLocListsSection(SimpleBinaryPatcher &DebugInfoPatcher);
9494

9595
/// Finalize debug sections in the main binary.
96-
void finalizeDebugSections(DebugInfoBinaryPatcher &DebugInfoPatcher);
96+
CUOffsetMap finalizeDebugSections(DebugInfoBinaryPatcher &DebugInfoPatcher);
9797

9898
/// Patches the binary for DWARF address ranges (e.g. in functions and lexical
9999
/// blocks) to be updated.
100100
void updateDebugAddressRanges();
101101

102102
/// Rewrite .gdb_index section if present.
103-
void updateGdbIndexSection();
103+
void updateGdbIndexSection(CUOffsetMap &CUMap);
104104

105105
/// Output .dwo files.
106106
void writeDWOFiles(std::unordered_map<uint64_t, std::string> &DWOIdToName);

0 commit comments

Comments
 (0)