Skip to content

Commit ce299cd

Browse files
committed
Merge remote-tracking branch 'intel/sycl' into optimize-build
2 parents 6e310b0 + bc3cf09 commit ce299cd

File tree

5,390 files changed

+150110
-94690
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,390 files changed

+150110
-94690
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/[email protected]
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: |

.github/workflows/sycl_containers.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ jobs:
107107
uses: actions/checkout@v2
108108
with:
109109
fetch-depth: 2
110+
- name: Get dependencies configuration
111+
id: deps
112+
run: |
113+
DEPS=`cat devops/dependencies.json`
114+
DEPS="${DEPS//'%'/'%25'}"
115+
DEPS="${DEPS//$'\n'/'%0A'}"
116+
DEPS="${DEPS//$'\r'/'%0D'}"
117+
echo $DEPS
118+
echo "::set-output name=deps::$DEPS"
110119
- name: Build and Push Container
111120
uses: ./devops/actions/build_container
112121
with:
@@ -117,4 +126,10 @@ jobs:
117126
tags: |
118127
ghcr.io/${{ github.repository }}/ubuntu2004_intel_drivers:unstable-${{ github.sha }}
119128
ghcr.io/${{ github.repository }}/ubuntu2004_intel_drivers:unstable
129+
build-args: |
130+
compute_runtime_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.compute_runtime.github_tag}}
131+
igc_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.igc.github_tag}}
132+
tbb_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.tbb.github_tag}}
133+
fpgaemu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.fpgaemu.github_tag}}
134+
cpu_tag=${{fromJson(steps.deps.outputs.deps).linux_staging.oclcpu.github_tag}}
120135

.github/workflows/sycl_nightly.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ jobs:
1919
build_cache_root: "/__w/"
2020
build_artifact_suffix: default
2121
lts_config: "ocl_gen9;ocl_x64;hip_amdgpu"
22+
23+
windows_default:
24+
name: Windows (experimental)
25+
if: github.repository == 'intel/llvm'
26+
uses: ./.github/workflows/sycl_windows_build_and_test.yml
27+
2228
ubuntu2004_docker_build_push:
2329
if: github.repository == 'intel/llvm'
2430
runs-on: ubuntu-latest
@@ -55,4 +61,14 @@ jobs:
5561
tags: |
5662
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers-${{ github.sha }}
5763
ghcr.io/${{ github.repository }}/sycl_ubuntu2004_nightly:no-drivers
58-
64+
ubuntu2004_build_test_new_pm:
65+
# Default Linux building and LIT testing using new Pass Manager by default
66+
if: github.repository == 'intel/llvm'
67+
uses: intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@sycl
68+
with:
69+
build_runs_on: build
70+
build_cache_root: "/__w/"
71+
build_cache_suffix: new_pm
72+
build_artifact_suffix: new_pm
73+
build_configure_extra_args: '--hip --hip-amd-arch=gfx906 --cuda --cmake-opt=-DLLVM_ENABLE_NEW_PASS_MANAGER=ON'
74+
lts_config: "hip_amdgpu;ocl_x64"

.github/workflows/sycl_precommit.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
branches:
66
- sycl
77

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
10-
cancel-in-progress: true
11-
128
jobs:
139
lint:
1410
runs-on: ubuntu-latest
@@ -34,4 +30,4 @@ jobs:
3430
build_cache_size: "8G"
3531
build_artifact_suffix: "default"
3632
build_cache_suffix: "default"
37-
lts_config: "hip_amdgpu;ocl_x64"
33+
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Stale Issues
2+
3+
on:
4+
schedule:
5+
- cron: '30 1 * * *'
6+
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/stale@v4
12+
with:
13+
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.'
14+
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please, re-open if the issue still exists.'
15+
days-before-stale: 180
16+
days-before-close: 30
17+
exempt-issue-labels: 'confirmed,hip,cuda,enhancement,help wanted,upstream'
18+
stale-issue-label: 'stale'
19+
exempt-all-issue-assignees: true
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: SYCL Windows Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: windows-2022
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
path: src
14+
fetch-depth: 1
15+
- name: Install dependencies
16+
shell: cmd
17+
run: |
18+
choco install -y cuda --version 11.6.0.51123
19+
choco install -y ninja
20+
refreshenv
21+
echo CUDA_PATH=%CUDA_PATH%
22+
echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV%
23+
- uses: ilammy/msvc-dev-cmd@9f8ae839b01883414208f29e3e24524387f48e1f
24+
with:
25+
arch: amd64
26+
- name: Setup Cache
27+
uses: actions/cache@v2
28+
if: ${{ github.event_name != 'pull_request' }}
29+
id: cache
30+
with:
31+
path: cache
32+
key: sycl-win-build-${{ github.sha }}
33+
restore-keys: |
34+
sycl-win-build-
35+
- name: Configure
36+
shell: cmd
37+
env:
38+
CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
39+
CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
40+
# TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83
41+
# TODO enable sccache, when problems with PDB are resolved
42+
run: |
43+
mkdir build
44+
mkdir install
45+
IF NOT EXIST cache MKDIR cache
46+
set SCCACHE_DIR=%GITHUB_WORKSPACE%\cache
47+
set PATH=C:\ProgramData\chocolatey\lib\sccache\tools\sccache-v0.2.15-x86_64-pc-windows-msvc;%PATH%
48+
python.exe src/buildbot/configure.py -o build ^
49+
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
50+
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
51+
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
52+
--cuda
53+
- name: Build
54+
shell: cmd
55+
env:
56+
CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
57+
CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
58+
run: |
59+
cmake --build build --target sycl-toolchain
60+
- name: Install
61+
shell: cmd
62+
run: cmake --build build --target deploy-sycl-toolchain
63+
- name: Upload toolchain
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: sycl_windows_default
67+
path: install/**/*

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)