Skip to content

Commit addfc7d

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into mem_mutex
2 parents 61b1cbc + e1619fa commit addfc7d

File tree

3,050 files changed

+93297
-38372
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,050 files changed

+93297
-38372
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ sycl/ @intel/llvm-reviewers-runtime
2525
sycl/ReleaseNotes.md @intel/dpcpp-doc-reviewers
2626
sycl/doc/ @intel/dpcpp-doc-reviewers
2727
sycl/doc/design/ @intel/dpcpp-specification-reviewers
28+
sycl/doc/design/spirv-extensions/ @intel/dpcpp-spirv-doc-reviewers
2829
sycl/doc/extensions/ @intel/dpcpp-specification-reviewers
29-
sycl/doc/extensions/SPIRV/ @intel/dpcpp-spirv-doc-reviewers
3030

3131
# Level Zero plugin
3232
sycl/plugins/level_zero/ @intel/dpcpp-l0-pi-reviewers
@@ -51,4 +51,4 @@ clang/tools/clang-offload-*/ @intel/dpcpp-tools-reviewers
5151
ESIMD/ @intel/dpcpp-esimd-reviewers
5252
esimd/ @intel/dpcpp-esimd-reviewers
5353
sycl/include/sycl/ext/intel/experimental/esimd.hpp @intel/dpcpp-esimd-reviewers
54-
sycl/doc/extensions/ExplicitSIMD/ @intel/dpcpp-esimd-reviewers
54+
sycl/doc/extensions/experimental/sycl_ext_intel_esimd/ @intel/dpcpp-esimd-reviewers

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ on:
1919
types:
2020
- created
2121
- edited
22+
issues:
23+
types:
24+
- opened
2225

2326
env:
24-
COMMENT_BODY: ${{ github.event.comment.body }}
27+
COMMENT_BODY: ${{ github.event.action == 'opened' && github.event.issue.body || github.event.comment.body }}
2528

2629
jobs:
2730
backport-commits:
@@ -30,7 +33,7 @@ jobs:
3033
if: >-
3134
(github.repository == 'llvm/llvm-project') &&
3235
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
33-
contains(github.event.comment.body, '/cherry-pick')
36+
contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
3437
steps:
3538
- name: Fetch LLVM sources
3639
uses: actions/checkout@v2

.github/workflows/issue-subscriber.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ jobs:
1818
pip install -r requirements.txt
1919
2020
- 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 }}
2124
run: |
2225
./github-automation.py \
23-
--token ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }} \
26+
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \
2427
issue-subscriber \
25-
--issue-number ${{ github.event.issue.number }} \
26-
--label-name ${{ github.event.label.name }}
28+
--issue-number '${{ github.event.issue.number }}' \
29+
--label-name "$LABEL_NAME"

CONTRIBUTING.md

Lines changed: 39 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,18 @@ these terms.
1515

1616
### Development
1717

18-
**NB**: For any changes not related to DPC++, but rather to LLVM in general, it
19-
is strongly encouraged that you submit the patch to https://llvm.org/ directly.
20-
See [LLVM contribution guidelines](https://llvm.org/docs/Contributing.html)
21-
for more information.
18+
For any changes not related to Intel Project for LLVM\* technology, but rather
19+
to LLVM in general, it is strongly encouraged that you submit the patch to
20+
https://llvm.org/ directly. See
21+
[LLVM contribution guidelines](https://llvm.org/docs/Contributing.html) for
22+
more information.
2223

23-
**NB**: A change in compiler and runtime should be accompanied with
24-
corresponding test changes.
25-
See [Test DPC++ toolchain](sycl/doc/GetStartedGuide.md#test-dpc-toolchain)
26-
section of Get Started guide for more information.
24+
Every change should be accompanied with corresponding test modification (adding
25+
new test(s), extending, removing or modifying existing test(s)).
2726

28-
**Note (October, 2020)**: DPC++ runtime and compiler ABI is currently in frozen
29-
state. This means that no ABI-breaking changes will be accepted by default.
30-
Project maintainers may still approve breaking changes in some cases. Please,
31-
see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information.
27+
To contribute:
3228

3329
- Create a personal fork of the project on GitHub
34-
- For the DPC++ Compiler project, use **sycl** branch as baseline for your
35-
changes. See [Get Started Guide](sycl/doc/GetStartedGuide.md).
3630
- Prepare your patch
3731
- follow [LLVM coding standards](https://llvm.org/docs/CodingStandards.html)
3832
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and
@@ -47,110 +41,41 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information.
4741
./clang/tools/clang-format/git-clang-format `git merge-base origin/sycl HEAD`
4842
```
4943

50-
to check the format of your current changes against the `origin/sycl`
51-
branch.
44+
to check the format of your current changes. `origin/sycl` branch is an
45+
example here
5246
- `-f` to also correct unstaged changes
5347
- `--diff` to only print the diff without applying
54-
- Build the project following
55-
[Get Started Guide instructions](sycl/doc/GetStartedGuide.md#build-dpc-toolchain).
56-
- Run regression tests -
57-
[instructions](sycl/doc/GetStartedGuide.md#test-dpc-toolchain).
5848

59-
### Tests development
49+
#### Project-specific contribution guidelines
6050

61-
Every product change should be accompanied with corresponding test modification
62-
(adding new test(s), extending, removing or modifying existing test(s)).
51+
- [Contribute to DPC++](/../sycl/sycl/doc/developer/ContributeToDPCPP.md)
6352

64-
There are 3 types of tests which are used for DPC++ toolchain validation:
65-
* DPC++ in-tree tests including [check-llvm](llvm/test),
66-
[check-clang](clang/test), [check-llvm-spirv](llvm-spirv/test) and
67-
[check-sycl](sycl/test) targets stored in this repository. These tests
68-
should not have hardware (e.g. GPU, FPGA, etc.) or external software
69-
dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following
70-
this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
71-
Generally, any functional change to any of the DPC++ toolchain components
72-
should be accompanied by one or more tests of this type when possible. They
73-
allow verifying individual components and tend to be more lightweight than
74-
end-to-end or SYCL-CTS tests.
53+
### Pull request
7554

76-
**General guidelines for adding DPC++ in-tree tests**:
77-
78-
- Use `sycl::` namespace instead of `cl::sycl::`
79-
80-
- Add a helpful comment describing what the test does at the beginning and
81-
other comments throughout the test as necessary.
82-
83-
- Try to follow descriptive naming convention for variables, functions as
84-
much as possible.
85-
Please refer to
86-
[LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)
87-
88-
**DPC++ clang FE tests**:
89-
90-
- Include sycl mock headers as system headers.
91-
Example: `-internal-isystem %S/Inputs`
92-
`#include "sycl.hpp"`
93-
94-
- Use SYCL functions for invoking kernels from the mock header
95-
`(single_task, parallel_for, parallel_for_work_group)`
96-
Example:
97-
```bash
98-
`#include "Inputs/sycl.hpp"`
99-
sycl::queue q;
100-
q.submit([&](cl::sycl::handler &h) {
101-
h.single_task( { //code });
102-
});
103-
```
104-
105-
**DPC++ headers and runtime tests**:
106-
107-
- [check-sycl](sycl/test) target contains 2 types of tests: LIT tests and
108-
unit tests. LIT tests make compile-time checks of DPC++ headers, e.g. device
109-
code IR verification, static_assert tests. Unit tests check DPC++ runtime
110-
behavior and do not perform any device code compilation, instead relying on
111-
redefining plugin API with [PiMock](sycl/unittests/helpers/PiMock.hpp) when
112-
necessary.
113-
114-
* DPC++ end-to-end (E2E) tests which are extension to
115-
[LLVM\* test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL).
116-
A test which requires full stack including backend runtimes (e.g. OpenCL,
117-
Level Zero or CUDA) should be put to DPC++ E2E test suite following
118-
[CONTRIBUTING](https://github.com/intel/llvm-test-suite/blob/intel/CONTRIBUTING.md).
119-
120-
* SYCL-CTS are official
121-
[Khronos\* SYCL\* conformance tests](https://github.com/KhronosGroup/SYCL-CTS).
122-
They verify SYCL specification compatibility. All implementation details or
123-
extensions are out of scope for the tests. If SYCL specification has changed
124-
(SYCL CTS tests conflict with recent version of SYCL specification) or change
125-
is required in the way the tests are built with DPC++ compiler (defined in
126-
[FindIntel_SYCL](https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-1.2.1/master/cmake/FindIntel_SYCL.cmake))
127-
pull request should be created under
128-
[KhronosGroup/SYCL-CTS](https://github.com/KhronosGroup/SYCL-CTS) with required
129-
patch.
130-
131-
### Commit message
132-
133-
- When writing your commit message, please make sure to follow
55+
- When creating your commit messages, please make sure to follow
13456
[LLVM developer policies](
13557
https://llvm.org/docs/DeveloperPolicy.html#commit-messages) on the subject.
136-
- For any DPC++-related commit, the `[SYCL]` tag should be present in the
137-
commit message title. To a reasonable extent, additional tags can be used
138-
to signify the component changed, e.g.: `[PI]`, `[CUDA]`, `[Doc]`.
139-
- For product changes which require modification in tests outside of the current repository
140-
(see [Test DPC++ toolchain](sycl/doc/GetStartedGuide.md#test-dpc-toolchain)),
141-
the commit message should contain the link to corresponding test PR, e.g.: E2E
142-
test changes are available under intel/llvm-test-suite#88 or SYCL
143-
conformance test changes are available under KhronosGroup/SYCL-CTS#65 (see
144-
[Autolinked references and URLs](https://docs.github.com/en/free-pro-team/github/writing-on-github/autolinked-references-and-urls)
58+
- [The seven rules of a great Git commit message](https://cbea.ms/git-commit)
59+
are recommended read and follow.
60+
- To a reasonable extent, title tags can be used to signify the component
61+
changed, e.g.: `[PI]`, `[CUDA]`, `[Doc]`.
62+
- Create a pull request (PR) for your changes following
63+
[Creating a pull request instructions](https://help.github.com/articles/creating-a-pull-request/).
64+
- Make sure PR has a good description explaining all of the changes made,
65+
represented by commits in the PR.
66+
- When PR is merged all commits are squashed and PR description is used as
67+
the merged commit message.
68+
- Consider splitting the large set of changes on small independent PRs that
69+
can be reviewed, tested and merged independently.
70+
- For changes which require modification in tests outside of the current repository
71+
the commit message should contain the link to corresponding test PR.
72+
For example: intel/llvm-test-suite#88 or KhronosGroup/SYCL-CTS#65. (see
73+
[Autolinked references and URLs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls)
14574
for more details). The same message should be present both in commit
14675
message and in PR description.
14776

14877
### Review and acceptance testing
14978

150-
- Create a pull request for your changes following [Creating a pull request
151-
instructions](https://help.github.com/articles/creating-a-pull-request/).
152-
- CI will run a signed-off check as soon as your PR is created - see the
153-
**check_pr** CI action results.
15479
- CI will run several build and functional testing checks as soon as the PR is
15580
approved by an Intel representative.
15681
- A new approval is needed if the PR was updated (e.g. during code review).
@@ -159,12 +84,14 @@ ready for merge.
15984

16085
### Merge
16186

162-
Project maintainers merge pull requests using one of the following options:
87+
Project gatekeepers (@intel/llvm-gatekeepers) merge pull requests using [Squash
88+
and merge] and using PR description as the commit message, replacing all
89+
individual comments made per commit. Authors of the change must ensure PR
90+
description is up to date at the merge stage, as sometimes comments addressed
91+
during code reviews can invalidate original PR description. Feel free to ping
92+
@intel/llvm-gatekeepers if your PR is green and can be merged.
16393

164-
- [Rebase and merge] The preferable choice for PRs containing a single commit
165-
- [Squash and merge] Used when there are multiple commits in the PR
166-
- Squashing is done to make sure that the project is buildable on any commit
167-
- [Create a merge commit] Used for LLVM pull-down PRs to preserve hashes of the
168-
commits pulled from the LLVM community repository
94+
Pulldown from LLVM upstream is done through merge commits to preserve hashes of
95+
the original commits pulled from the LLVM community repository.
16996

170-
*Other names and brands may be claimed as the property of others.
97+
<sub>\*Other names and brands may be claimed as the property of others.</sub>

README.md

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,86 @@
11
# Intel Project for LLVM\* technology
22

3-
Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects:
3+
This is the Intel staging area for llvm.org contributions and the home for
4+
Intel LLVM-based projects:
5+
6+
- [oneAPI Data Parallel C++ compiler](#oneapi-data-parallel-c-compiler)
7+
- [Late-outline OpenMP and OpenMP Offload](#late-outline-openmp-and-openmp-offload)
48

59
## oneAPI Data Parallel C++ compiler
610

711
[![](https://spec.oneapi.io/oneapi-logo-white-scaled.jpg)](https://www.oneapi.io/)
812

9-
See [sycl](https://github.com/intel/llvm/tree/sycl) branch and
10-
[DPC++ Documentation](https://intel.github.io/llvm-docs/).
11-
1213
[![Linux Post Commit Checks](https://github.com/intel/llvm/workflows/Linux%20Post%20Commit%20Checks/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Linux+Post+Commit+Checks%22)
1314
[![Generate Doxygen documentation](https://github.com/intel/llvm/workflows/Generate%20Doxygen%20documentation/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Generate+Doxygen+documentation%22)
1415

15-
DPC++ is an open, cross-architecture language built upon the ISO C++ and Khronos
16-
SYCL\* standards. DPC++ extends these standards with a number of extensions,
17-
which can be found in [sycl/doc/extensions](sycl/doc/extensions) directory.
16+
The Data Parallel C++ or DPC++ is a LLVM-based compiler project that implements
17+
compiler and runtime support for the SYCL\* language. The project is hosted in
18+
the [sycl](/../../tree/sycl) branch and is synced with the tip of the LLVM
19+
upstream main branch on a regular basis (revisions delay is usually not more
20+
than 1-2 weeks). DPC++ compiler takes everything from LLVM upstream as is,
21+
however some modules of LLVM might be not included in the default project build
22+
configuration. Additional modules can be enabled by modifying build framework
23+
settings.
1824

19-
## Late-outline OpenMP\* and OpenMP\* Offload
20-
See [openmp](https://github.com/intel/llvm/tree/openmp) branch.
25+
The DPC++ goal is to support the latest SYCL\* standard and work on that is in
26+
progress. DPC++ also implements a number of extensions to the SYCL\* standard,
27+
which can be found in the [sycl/doc/extensions](/../sycl/sycl/doc/extensions)
28+
directory.
2129

22-
# License
30+
The main purpose of this project is open source collaboration on the DPC++
31+
compiler implementation in LLVM across a variety of architectures, prototyping
32+
compiler and runtime library solutions, designing future extensions, and
33+
conducting experiments. As the implementation becomes more mature, we try to
34+
upstream as much DPC++ support to LLVM main branch as possible. See
35+
[SYCL upstreaming working group notes](/../../wiki/SYCL-upstreaming-working-group-meeting-notes)
36+
for more details.
37+
38+
Note that this project can be used as a technical foundation for some
39+
proprietary compiler products, which may leverage implementations from this open
40+
source project. One of the examples is
41+
[Intel(R) oneAPI DPC++ Compiler](https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html)
42+
Features parity between this project and downstream projects is not guaranteed.
43+
44+
Project documentation is available at:
45+
[DPC++ Documentation](https://intel.github.io/llvm-docs/).
46+
47+
### How to use DPC++
48+
49+
#### Docker containers
50+
51+
See available containers with pre-built/pre-installed DPC++ compiler at:
52+
[Containers](/../sycl/sycl/doc/developer/DockerBKMs.md#sycl-containers-overview)
2353

24-
See [LICENSE.txt](sycl/LICENSE.TXT) for details.
54+
#### Releases
2555

26-
# Contributing
56+
Daily builds of the sycl branch on Linux are available at
57+
[releases](/../../releases).
58+
A few times a year, we publish [Release Notes](/../sycl/sycl/ReleaseNotes.md) to
59+
highlight all important changes made in the project: features implemented and
60+
issues addressed. The corresponding builds can be found using
61+
[search](https://github.com/intel/llvm/releases?q=oneAPI+DPC%2B%2B+Compiler&expanded=true)
62+
in daily releases. None of the branches in the project are stable or rigorously
63+
tested for production quality control, so the quality of these releases is
64+
expected to be similar to the daily releases.
65+
66+
#### Build from sources
67+
68+
See [Get Started Guide](/../sycl/sycl/doc/GetStartedGuide.md).
69+
70+
### Report a problem
71+
72+
Submit an [issue](/../../issues) or initiate a [discussion](/../../discussions).
73+
74+
### How to contribute to DPC++
75+
76+
See [ContributeToDPCPP](/../sycl/sycl/doc/developer/ContributeToDPCPP.md).
77+
78+
## Late-outline OpenMP\* and OpenMP\* Offload
79+
80+
See [openmp](/../../tree/openmp) branch.
81+
82+
# License
2783

28-
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
84+
See [LICENSE](/../sycl/sycl/LICENSE.TXT) for details.
2985

30-
*\*Other names and brands may be claimed as the property of others.*
86+
<sub>\*Other names and brands may be claimed as the property of others.</sub>

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class BinaryContext {
211211
std::map<unsigned, DwarfLineTable> DwarfLineTablesCUMap;
212212

213213
public:
214-
static std::unique_ptr<BinaryContext>
214+
static Expected<std::unique_ptr<BinaryContext>>
215215
createBinaryContext(const ObjectFile *File, bool IsPIC,
216216
std::unique_ptr<DWARFContext> DwCtx);
217217

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ class MCPlusBuilder {
7474
AllocatorIdTy MaxAllocatorId = 0;
7575

7676
/// We encode Index and Value into a 64-bit immediate operand value.
77-
static int64_t encodeAnnotationImm(unsigned Index, int64_t Value) {
78-
assert(Index < 256 && "annotation index max value exceeded");
79-
assert((Value == (Value << 8) >> 8) && "annotation value out of range");
77+
static int64_t encodeAnnotationImm(uint8_t Index, int64_t Value) {
78+
if (LLVM_UNLIKELY(Value != extractAnnotationValue(Value)))
79+
report_fatal_error("annotation value out of range");
8080

8181
Value &= 0xff'ffff'ffff'ffff;
8282
Value |= (int64_t)Index << 56;
@@ -85,14 +85,13 @@ class MCPlusBuilder {
8585
}
8686

8787
/// Extract annotation index from immediate operand value.
88-
static unsigned extractAnnotationIndex(int64_t ImmValue) {
88+
static uint8_t extractAnnotationIndex(int64_t ImmValue) {
8989
return ImmValue >> 56;
9090
}
9191

9292
/// Extract annotation value from immediate operand value.
9393
static int64_t extractAnnotationValue(int64_t ImmValue) {
94-
ImmValue &= 0xff'ffff'ffff'ffff;
95-
return (ImmValue << 8) >> 8;
94+
return SignExtend64<56>(ImmValue & 0xff'ffff'ffff'ffffULL);
9695
}
9796

9897
MCInst *getAnnotationInst(const MCInst &Inst) const {

bolt/include/bolt/Passes/ShrinkWrapping.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ class ShrinkWrapping {
308308
std::vector<MCInst *> BestSavePos;
309309

310310
/// Pass stats
311-
static uint64_t SpillsMovedRegularMode;
312-
static uint64_t SpillsMovedPushPopMode;
311+
static std::atomic_uint64_t SpillsMovedRegularMode;
312+
static std::atomic_uint64_t SpillsMovedPushPopMode;
313313

314314
Optional<unsigned> AnnotationIndex;
315315

0 commit comments

Comments
 (0)