Skip to content

Commit e057eb2

Browse files
committed
Merge from 'sycl' to 'sycl-web' (#1)
Reapply f5360d4 as part of the conflict resolution, as newer changes rely on it. It was previously reverted in 3a02d78. CONFLICT (modify/delete): clang/test/Parser/fp-floatcontrol-syntax.cpp deleted in 40287bf and modified in HEAD. Version HEAD of clang/test/Parser/fp-floatcontrol-syntax.cpp left in tree. CONFLICT (modify/delete): clang/test/CodeGen/fp-floatcontrol-pragma.cpp deleted in 40287bf and modified in HEAD. Version HEAD of clang/test/CodeGen/fp-floatcontrol-pragma.cpp left in tree. CONFLICT (content): Merge conflict in clang/lib/Sema/SemaAttr.cpp CONFLICT (content): Merge conflict in clang/lib/Parse/ParsePragma.cpp CONFLICT (content): Merge conflict in clang/include/clang/Sema/Sema.h CONFLICT (content): Merge conflict in clang/include/clang/Basic/LangOptions.h CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticParseKinds.td
2 parents b257bf9 + 40287bf commit e057eb2

File tree

199 files changed

+27832
-3320
lines changed

Some content is hidden

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

199 files changed

+27832
-3320
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ sycl/include/CL/sycl/intel/fpga_reg.hpp @MrSidims
6363
sycl/include/CL/sycl/intel/pipes.hpp @MrSidims
6464
sycl/include/CL/sycl/pipes.hpp @MrSidims
6565

66+
# Reduction extension
67+
sycl/include/CL/sycl/intel/reduction.hpp @v-klochkov
68+
6669
# Function pointers
6770
sycl/include/CL/sycl/intel/function_pointer.hpp @AlexeySachkov
6871
sycl/source/function_pointer.cpp @AlexeySachkov
@@ -75,6 +78,7 @@ sycl/source/half_type.cpp @AlexeySachkov
7578
sycl/include/CL/sycl/swizzles.def @turinevgeny
7679
sycl/include/CL/sycl/types.hpp @turinevgeny
7780

81+
sycl/plugins/cuda/ @intel/llvm-reviewers-cuda
7882

7983
sycl/doc/ @pvchupin @kbobrovs
8084

CONTRIBUTING.md

Lines changed: 13 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,15 @@
11
# Contributing
22

33
## License
4-
Intel Project for LLVM\* technology is licensed under the terms of the
5-
Apache-2.0 with LLVM-exception license ([LICENSE.txt](llvm/LICENSE.TXT))
6-
to ensure our ability to contribute this project to the LLVM project
7-
under the same license.
84

9-
By contributing to this project, you agree to the Apache-2.0 with
10-
LLVM-exception license and copyright terms there in and release your
11-
contribution under these terms.
5+
Intel Project for LLVM\* technology is licensed under the terms of the Apache
6+
License v2.0 with LLVM Exceptions license ([LICENSE.txt](llvm/LICENSE.TXT)) to
7+
ensure our ability to contribute this project to the LLVM project under the
8+
same license.
129

13-
## Sign your work
14-
Please use the sign-off line at the end of your contribution. Your
15-
signature certifies that you wrote the contribution or otherwise have
16-
the right to pass it on as an open-source contribution, and that you
17-
agree to provide your contribution under the terms of the licenses
18-
noted above. The rules are pretty simple: if you can certify the
19-
below (from [developercertificate.org](http://developercertificate.org)):
20-
21-
```
22-
Developer Certificate of Origin
23-
Version 1.1
24-
25-
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
26-
660 York Street, Suite 102,
27-
San Francisco, CA 94110 USA
28-
29-
Everyone is permitted to copy and distribute verbatim copies of this
30-
license document, but changing it is not allowed.
31-
32-
Developer's Certificate of Origin 1.1
33-
34-
By making a contribution to this project, I certify that:
35-
36-
(a) The contribution was created in whole or in part by me and I
37-
have the right to submit it under the open source license
38-
indicated in the file; or
39-
40-
(b) The contribution is based upon previous work that, to the best
41-
of my knowledge, is covered under an appropriate open source
42-
license and I have the right under that license to submit that
43-
work with modifications, whether created in whole or in part
44-
by me, under the same open source license (unless I am
45-
permitted to submit under a different license), as indicated
46-
in the file; or
47-
48-
(c) The contribution was provided directly to me by some other
49-
person who certified (a), (b) or (c) and I have not modified
50-
it.
51-
52-
(d) I understand and agree that this project and the contribution
53-
are public and that a record of the contribution (including all
54-
personal information I submit with it, including my sign-off) is
55-
maintained indefinitely and may be redistributed consistent with
56-
this project or the open source license(s) involved.
57-
```
58-
59-
Then you just add a line to every git commit message:
60-
61-
Signed-off-by: Joe Smith <[email protected]>
62-
63-
Use your real name (sorry, no pseudonyms or anonymous contributions.)
64-
65-
If you set your `user.name` and `user.email` git configs, you can sign your
66-
commit automatically with `git commit -s`.
10+
By contributing to this project, you agree to the Apache License v2.0 with LLVM
11+
Exceptions and copyright terms there in and release your contribution under
12+
these terms.
6713

6814
## Contribution process
6915

@@ -79,14 +25,16 @@ for more information.
7925
changes. See [Get Started Guide](sycl/doc/GetStartedGuide.md).
8026
- Prepare your patch
8127
- follow [LLVM coding standards](https://llvm.org/docs/CodingStandards.html)
82-
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and
83-
[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) tools can be integrated into your
84-
workflow to ensure formatting and stylistic compliance of your changes.
28+
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and
29+
[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) tools can be
30+
integrated into your workflow to ensure formatting and stylistic
31+
compliance of your changes.
8532
- use
8633
```
8734
./clang/tools/clang-format/git-clang-format `git merge-base origin/sycl HEAD`
8835
```
89-
to check the format of your current changes against the `origin/sycl` branch.
36+
to check the format of your current changes against the `origin/sycl`
37+
branch.
9038
- `-f` to also correct unstaged changes
9139
- `--diff` to only print the diff without applying
9240
- Build the project and run all tests.
@@ -125,5 +73,4 @@ Project maintainers merge pull requests using one of the following options:
12573
- [Create a merge commit] Used for LLVM pull-down PRs to preserve hashes of the
12674
commits pulled from the LLVM community repository
12775
128-
12976
*Other names and brands may be claimed as the property of others.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Intel staging area for llvm.org contribution.
66
Home for Intel LLVM-based projects:
77
- oneAPI Data Parallel C++ compiler - see **sycl** branch. More information on
88
oneAPI and DPC++ is available at
9-
([https://www.oneapi.com/](https://www.oneapi.com/))
9+
[https://www.oneapi.com/](https://www.oneapi.com/)
1010
- [![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)
1111
[![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)
1212

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,28 @@ void SYCLToolChain::TranslateTargetOpt(const llvm::opt::ArgList &Args,
472472
}
473473
}
474474

475+
static void addImpliedArgs(const llvm::Triple &Triple,
476+
const llvm::opt::ArgList &Args,
477+
llvm::opt::ArgStringList &CmdArgs) {
478+
// Current implied args are for debug information and disabling of
479+
// optimizations.
480+
// TODO: Add support for other architectures (gen, x86_64) as those are
481+
// being defined.
482+
if (Triple.getSubArch() == llvm::Triple::NoSubArch ||
483+
Triple.getSubArch() == llvm::Triple::SPIRSubArch_fpga) {
484+
if (Arg *A = Args.getLastArg(options::OPT_g_Group, options::OPT__SLASH_Z7))
485+
if (!A->getOption().matches(options::OPT_g0))
486+
CmdArgs.push_back("-g");
487+
if (Args.getLastArg(options::OPT_O0))
488+
CmdArgs.push_back("-cl-opt-disable");
489+
}
490+
}
491+
475492
void SYCLToolChain::TranslateBackendTargetArgs(const llvm::opt::ArgList &Args,
476493
llvm::opt::ArgStringList &CmdArgs) const {
494+
// Add any implied arguments before user defined arguments.
495+
addImpliedArgs(getTriple(), Args, CmdArgs);
496+
477497
// Handle -Xs flags.
478498
for (auto *A : Args) {
479499
// When parsing the target args, the -Xs<opt> type option applies to all

clang/lib/Sema/SPIRVBuiltins.td

Lines changed: 82 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -485,23 +485,16 @@ foreach name = ["half_cos",
485485
"half_exp", "half_exp2", "half_exp10",
486486
"half_log", "half_log2", "half_log10",
487487
"half_recip", "half_rsqrt",
488-
"half_sin", "half_sqrt", "half_tan"] in {
489-
def : ConstOCLSPVBuiltin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar]>;
490-
}
491-
492-
foreach name = ["half_divide", "half_powr"] in {
493-
def : ConstOCLSPVBuiltin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar]>;
494-
}
495-
496-
foreach name = ["native_cos", "native_exp", "native_exp2", "native_exp10",
488+
"half_sin", "half_sqrt", "half_tan",
489+
"native_cos", "native_exp", "native_exp2", "native_exp10",
497490
"native_log", "native_log2", "native_log10",
498491
"native_recip", "native_rsqrt",
499492
"native_sin", "native_sqrt", "native_tan"] in {
500-
def : ConstOCLSPVBuiltin<name, [FGenTypeN, FGenTypeN]>;
493+
def : ConstOCLSPVBuiltin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar]>;
501494
}
502495

503-
foreach name = ["native_divide", "native_powr"] in {
504-
def : ConstOCLSPVBuiltin<name, [FGenTypeN, FGenTypeN, FGenTypeN]>;
496+
foreach name = ["half_divide", "half_powr", "native_divide", "native_powr"] in {
497+
def : ConstOCLSPVBuiltin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar]>;
505498
}
506499

507500
// 2.2. Integer instructions
@@ -635,20 +628,22 @@ foreach VSize = [2, 3, 4, 8, 16] in {
635628
}
636629
}
637630
foreach name = ["vloada_halfn", "vload_halfn"] in {
638-
def : OCLSPVBuiltin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, AS>]>;
631+
def : OCLSPVBuiltin<name # "_Rfloat" # VSize, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, AS>]>;
639632
}
640633
}
641634
foreach AS = [GlobalAS, LocalAS, PrivateAS, GenericAS, DefaultAS] in {
642635
foreach Ty = TLAll.List in {
643636
foreach name = ["vstoren"] in {
644-
def : OCLSPVBuiltin<name, [Void, VectorType<Ty, VSize>, Size, PointerType<ConstType<Ty>, AS>]>;
637+
def : OCLSPVBuiltin<name, [Void, VectorType<Ty, VSize>, Size, PointerType<Ty, AS>]>;
645638
}
646639
}
647-
foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in {
648-
foreach name = ["vstore_halfn" # rnd, "vstorea_halfn" # rnd] in {
649-
def : OCLSPVBuiltin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, AS>]>;
650-
def : OCLSPVBuiltin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, AS>]>;
651-
}
640+
foreach name = ["vstore_halfn", "vstorea_halfn"] in {
641+
def : OCLSPVBuiltin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, AS>]>;
642+
def : OCLSPVBuiltin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, AS>]>;
643+
}
644+
foreach name = ["vstore_halfn_r", "vstorea_halfn_r"] in {
645+
def : OCLSPVBuiltin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, AS>, UInt]>;
646+
def : OCLSPVBuiltin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, AS>, UInt]>;
652647
}
653648
}
654649
}
@@ -660,11 +655,13 @@ foreach AS = [GlobalAS, LocalAS, PrivateAS, ConstantAS, GenericAS, DefaultAS] in
660655
}
661656

662657
foreach AS = [GlobalAS, LocalAS, PrivateAS, GenericAS, DefaultAS] in {
663-
foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in {
664-
foreach name = ["vstore_half" # rnd] in {
665-
def : OCLSPVBuiltin<name, [Void, Float, Size, PointerType<Half, AS>]>;
666-
def : OCLSPVBuiltin<name, [Void, Double, Size, PointerType<Half, AS>]>;
667-
}
658+
foreach name = ["vstore_half"] in {
659+
def : OCLSPVBuiltin<name, [Void, Float, Size, PointerType<Half, AS>]>;
660+
def : OCLSPVBuiltin<name, [Void, Double, Size, PointerType<Half, AS>]>;
661+
}
662+
foreach name = ["vstore_half_r"] in {
663+
def : OCLSPVBuiltin<name, [Void, Float, Size, PointerType<Half, AS>, UInt]>;
664+
def : OCLSPVBuiltin<name, [Void, Double, Size, PointerType<Half, AS>, UInt]>;
668665
}
669666
}
670667

@@ -710,72 +707,79 @@ foreach name = ["GenericPtrMemSemantics"] in {
710707
}
711708

712709
// 3.32.11. Conversion Instructions
713-
714-
foreach IType = [UChar, UShort, UInt, ULong] in {
715-
foreach FType = [Float, Double, Half] in {
716-
def : SPVBuiltin<"ConvertUToF_R" # FType.Name, [FType, IType], Attr.Const>;
717-
foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in {
718-
def : SPVBuiltin<"ConvertFToU_R" # IType.Name # rnd, [IType, FType], Attr.Const>;
719-
}
720-
foreach v = [2, 3, 4, 8, 16] in {
721-
def : SPVBuiltin<"ConvertFToU_R" # IType.Name # v,
722-
[VectorType<IType, v>, VectorType<FType, v>],
723-
Attr.Const>;
724-
def : SPVBuiltin<"ConvertUToF_R" # FType.Name # v,
725-
[VectorType<FType, v>, VectorType<IType, v>],
726-
Attr.Const>;
727-
}
728-
}
729-
}
730-
731-
foreach IType = [Char, Short, Int, Long] in {
732-
foreach FType = [Float, Double, Half] in {
733-
def : SPVBuiltin<"ConvertSToF_R" # FType.Name, [FType, IType], Attr.Const>;
734-
foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in {
735-
def : SPVBuiltin<"ConvertFToS_R" # IType.Name # rnd, [IType, FType], Attr.Const>;
736-
}
737-
foreach v = [2, 3, 4, 8, 16] in {
738-
def : SPVBuiltin<"ConvertFToS_R" # IType.Name # v,
739-
[VectorType<IType, v>, VectorType<FType, v>],
740-
Attr.Const>;
741-
def : SPVBuiltin<"ConvertSToF_R" # FType.Name # v,
742-
[VectorType<FType, v>, VectorType<IType, v>],
743-
Attr.Const>;
710+
foreach rnd = ["", "_rte", "_rtn", "_rtp", "_rtz"] in {
711+
foreach IType = TLUnsignedInts.List in {
712+
foreach FType = TLFloat.List in {
713+
foreach sat = ["", "_sat"] in {
714+
def : SPVBuiltin<"ConvertFToU_R" # IType.Name # sat # rnd, [IType, FType], Attr.Const>;
715+
}
716+
def : SPVBuiltin<"ConvertUToF_R" # FType.Name # rnd, [FType, IType], Attr.Const>;
717+
foreach v = [2, 3, 4, 8, 16] in {
718+
foreach sat = ["", "_sat"] in {
719+
def : SPVBuiltin<"ConvertFToU_R" # IType.Name # v # sat # rnd,
720+
[VectorType<IType, v>, VectorType<FType, v>],
721+
Attr.Const>;
722+
}
723+
def : SPVBuiltin<"ConvertUToF_R" # FType.Name # v # rnd,
724+
[VectorType<FType, v>, VectorType<IType, v>],
725+
Attr.Const>;
726+
}
744727
}
745728
}
746-
}
747729

748-
foreach InType = TLAll.List in {
749-
foreach OutType = TLUnsignedInts.List in {
750-
if !ne(OutType.ElementSize, InType.ElementSize) then {
751-
def : SPVBuiltin<"UConvert_R" # OutType.Name, [OutType, InType], Attr.Const>;
730+
foreach IType = TLSignedInts.List in {
731+
foreach FType = TLFloat.List in {
732+
foreach sat = ["", "_sat"] in {
733+
def : SPVBuiltin<"ConvertFToS_R" # IType.Name # sat # rnd, [IType, FType], Attr.Const>;
734+
}
735+
def : SPVBuiltin<"ConvertSToF_R" # FType.Name # rnd, [FType, IType], Attr.Const>;
752736
foreach v = [2, 3, 4, 8, 16] in {
753-
def : SPVBuiltin<"UConvert_R" # OutType.Name # v,
754-
[VectorType<OutType, v>, VectorType<InType, v>],
737+
foreach sat = ["", "_sat"] in {
738+
def : SPVBuiltin<"ConvertFToS_R" # IType.Name # v # sat # rnd,
739+
[VectorType<IType, v>, VectorType<FType, v>],
740+
Attr.Const>;
741+
}
742+
def : SPVBuiltin<"ConvertSToF_R" # FType.Name # v # rnd,
743+
[VectorType<FType, v>, VectorType<IType, v>],
755744
Attr.Const>;
756745
}
757746
}
758747
}
759-
foreach OutType = TLSignedInts.List in {
760-
if !ne(OutType.ElementSize, InType.ElementSize) then {
761-
def : SPVBuiltin<"SConvert_R" # OutType.Name, [OutType, InType], Attr.Const>;
762-
foreach v = [2, 3, 4, 8, 16] in {
763-
def : SPVBuiltin<"SConvert_R" # OutType.Name # v,
764-
[VectorType<OutType, v>, VectorType<InType, v>],
765-
Attr.Const>;
748+
749+
foreach InType = TLFloat.List in {
750+
foreach OutType = TLFloat.List in {
751+
if !ne(OutType.ElementSize, InType.ElementSize) then {
752+
def : SPVBuiltin<"FConvert_R" # OutType.Name # rnd, [OutType, InType], Attr.Const>;
753+
foreach v = [2, 3, 4, 8, 16] in {
754+
def : SPVBuiltin<"FConvert_R" # OutType.Name # v # rnd,
755+
[VectorType<OutType, v>, VectorType<InType, v>],
756+
Attr.Const>;
757+
}
766758
}
767759
}
768760
}
769761
}
770762

771-
foreach InType = TLFloat.List in {
772-
foreach OutType = TLFloat.List in {
773-
if !ne(OutType.ElementSize, InType.ElementSize) then {
774-
def : SPVBuiltin<"FConvert_R" # OutType.Name, [OutType, InType], Attr.Const>;
775-
foreach v = [2, 3, 4, 8, 16] in {
776-
def : SPVBuiltin<"FConvert_R" # OutType.Name # v,
777-
[VectorType<OutType, v>, VectorType<InType, v>],
778-
Attr.Const>;
763+
foreach sat = ["", "_sat"] in {
764+
foreach InType = TLAllInts.List in {
765+
foreach OutType = TLUnsignedInts.List in {
766+
if !ne(OutType.ElementSize, InType.ElementSize) then {
767+
def : SPVBuiltin<"UConvert_R" # OutType.Name # sat, [OutType, InType], Attr.Const>;
768+
foreach v = [2, 3, 4, 8, 16] in {
769+
def : SPVBuiltin<"UConvert_R" # OutType.Name # v # sat,
770+
[VectorType<OutType, v>, VectorType<InType, v>],
771+
Attr.Const>;
772+
}
773+
}
774+
}
775+
foreach OutType = TLSignedInts.List in {
776+
if !ne(OutType.ElementSize, InType.ElementSize) then {
777+
def : SPVBuiltin<"SConvert_R" # OutType.Name # sat, [OutType, InType], Attr.Const>;
778+
foreach v = [2, 3, 4, 8, 16] in {
779+
def : SPVBuiltin<"SConvert_R" # OutType.Name # v # sat,
780+
[VectorType<OutType, v>, VectorType<InType, v>],
781+
Attr.Const>;
782+
}
779783
}
780784
}
781785
}
@@ -809,7 +813,7 @@ foreach AS = [GlobalAS, LocalAS, PrivateAS] in {
809813

810814
foreach Type = TLFloat.List in {
811815
foreach v = [2, 3, 4, 8, 16] in {
812-
def : SPVBuiltin<"VectorTimesScalar", [VectorType<Type, v>, VectorType<Type, v>, Type]>;
816+
def : SPVBuiltin<"VectorTimesScalar", [VectorType<Type, v>, VectorType<Type, v>, Type], Attr.Const>;
813817
}
814818
}
815819

@@ -820,7 +824,6 @@ foreach name = ["Dot"] in {
820824
}
821825

822826
foreach name = ["Any", "All"] in {
823-
def : SPVBuiltin<name, [Bool, Bool], Attr.Const>;
824827
def : SPVBuiltin<name, [Bool, GenTypeSCharVecNoScalar], Attr.Const>;
825828
}
826829

0 commit comments

Comments
 (0)