Skip to content

Commit 534bc41

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 8c8c902 + 962b00a commit 534bc41

File tree

237 files changed

+6914
-2216
lines changed

Some content is hidden

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

237 files changed

+6914
-2216
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* @bader
22

33
# Front-end compiler
4-
clang/ @premanandrao @elizabethandrews
4+
clang/ @premanandrao @elizabethandrews @AaronBallman
55

66
# Driver
77
clang/**/Driver @mdtoguchi @AGindinson

.github/workflows/linux_post_commit.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
;;
2828
SharedLibs)
2929
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
30-
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main"
30+
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main"
3131
sudo apt-get update
32-
sudo apt-get install -y clang-13
32+
sudo apt-get install -y clang-12
3333
export ARGS="--shared-libs"
34-
export CC="clang-13"
35-
export CXX="clang++-13"
34+
export CC="clang-12"
35+
export CXX="clang++-12"
3636
;;
3737
NoAssertions)
3838
export ARGS="--no-assertions"

clang/include/clang/Basic/Attr.td

+16-23
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ def SYCL : LangOpt<"SYCL">;
337337
def SYCLIsDevice : LangOpt<"SYCLIsDevice">;
338338
def SYCLIsHost : LangOpt<"SYCLIsHost">;
339339
def SilentlyIgnoreSYCLIsHost : LangOpt<"SYCLIsHost", "", 1>;
340-
def SYCLExplicitSIMD : LangOpt<"SYCLExplicitSIMD">;
341340
def COnly : LangOpt<"", "!LangOpts.CPlusPlus">;
342341
def CPlusPlus : LangOpt<"CPlusPlus">;
343342
def OpenCL : LangOpt<"OpenCL">;
@@ -1195,7 +1194,6 @@ def SYCLSimd : InheritableAttr {
11951194
let Spellings = [GNU<"sycl_explicit_simd">,
11961195
CXX11<"intel", "sycl_explicit_simd">];
11971196
let Subjects = SubjectList<[Function, GlobalVar]>;
1198-
let LangOpts = [SYCLExplicitSIMD];
11991197
let Documentation = [SYCLSimdDocs];
12001198
let SupportsNonconformingLambdaSyntax = 1;
12011199
}
@@ -1208,7 +1206,6 @@ def SYCLRegisterNum : InheritableAttr {
12081206
let Subjects = SubjectList<[GlobalVar]>;
12091207
// This attribute is applied to file-scope variables and must be compilable
12101208
// for the host device as well
1211-
let LangOpts = [SYCLExplicitSIMD];
12121209
let Documentation = [SYCLRegisterNumDocs];
12131210
}
12141211

@@ -1221,7 +1218,6 @@ def SYCLSimdAccessorPtr : InheritableAttr {
12211218
// No spelling, as this attribute can't be created in the source code.
12221219
let Spellings = [];
12231220
let Subjects = SubjectList<[ParmVar]>;
1224-
let LangOpts = [SYCLExplicitSIMD];
12251221
let Documentation = [Undocumented];
12261222
}
12271223

@@ -1878,24 +1874,27 @@ def SYCLIntelFPGAIVDep : StmtAttr {
18781874
let Documentation = [SYCLIntelFPGAIVDepAttrDocs];
18791875
}
18801876

1881-
def SYCLIntelFPGAInitiationInterval : StmtAttr {
1877+
def SYCLIntelFPGAInitiationInterval : DeclOrStmtAttr {
18821878
let Spellings = [CXX11<"intelfpga","ii">,
18831879
CXX11<"intel","ii">,
18841880
CXX11<"intel", "initiation_interval">];
1885-
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt],
1886-
ErrorDiag, "'for', 'while', and 'do' statements">;
1881+
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt, Function],
1882+
ErrorDiag,
1883+
"'for', 'while', 'do' statements, and functions">;
18871884
let Args = [ExprArgument<"IntervalExpr", /*opt*/1>];
18881885
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
18891886
let HasCustomTypeTransform = 1;
18901887
let Documentation = [SYCLIntelFPGAInitiationIntervalAttrDocs];
1888+
let SupportsNonconformingLambdaSyntax = 1;
18911889
}
18921890

1893-
def SYCLIntelFPGAMaxConcurrency : StmtAttr {
1891+
def SYCLIntelFPGAMaxConcurrency : DeclOrStmtAttr {
18941892
let Spellings = [CXX11<"intelfpga","max_concurrency">,
18951893
CXX11<"intel","max_concurrency">];
1896-
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt],
1897-
ErrorDiag, "'for', 'while', and 'do' statements">;
1898-
let Args = [ExprArgument<"NThreadsExpr", /*opt*/1>];
1894+
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt, Function],
1895+
ErrorDiag,
1896+
"'for', 'while', 'do' statements, and functions">;
1897+
let Args = [ExprArgument<"NThreadsExpr">];
18991898
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
19001899
let HasCustomTypeTransform = 1;
19011900
let Documentation = [SYCLIntelFPGAMaxConcurrencyAttrDocs];
@@ -1912,14 +1911,16 @@ def SYCLIntelFPGALoopCoalesce : StmtAttr {
19121911
let Documentation = [SYCLIntelFPGALoopCoalesceAttrDocs];
19131912
}
19141913

1915-
def SYCLIntelFPGADisableLoopPipelining : StmtAttr {
1914+
def SYCLIntelFPGADisableLoopPipelining : DeclOrStmtAttr {
19161915
let Spellings = [CXX11<"intelfpga","disable_loop_pipelining">,
19171916
CXX11<"intel","disable_loop_pipelining">];
1918-
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt],
1919-
ErrorDiag, "'for', 'while', and 'do' statements">;
1917+
let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt, Function],
1918+
ErrorDiag,
1919+
"'for', 'while', 'do' statements, and functions">;
19201920
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
19211921
let HasCustomTypeTransform = 1;
19221922
let Documentation = [SYCLIntelFPGADisableLoopPipeliningAttrDocs];
1923+
let SupportsNonconformingLambdaSyntax = 1;
19231924
}
19241925

19251926
def SYCLIntelFPGAMaxInterleaving : StmtAttr {
@@ -2119,22 +2120,14 @@ def IntelFPGABankBits : Attr {
21192120
let Documentation = [IntelFPGABankBitsDocs];
21202121
}
21212122

2122-
def IntelFPGAForcePow2Depth : Attr {
2123+
def IntelFPGAForcePow2Depth : InheritableAttr {
21232124
let Spellings = [CXX11<"intelfpga","force_pow2_depth">,
21242125
CXX11<"intel","force_pow2_depth">];
21252126
let Args = [ExprArgument<"Value">];
21262127
let Subjects = SubjectList<[IntelFPGAConstVar, IntelFPGALocalStaticSlaveMemVar,
21272128
Field], ErrorDiag>;
21282129
let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
21292130
let Documentation = [IntelFPGAForcePow2DepthAttrDocs];
2130-
let AdditionalMembers = [{
2131-
static unsigned getMinValue() {
2132-
return 0;
2133-
}
2134-
static unsigned getMaxValue() {
2135-
return 1;
2136-
}
2137-
}];
21382131
}
21392132

21402133
def Naked : InheritableAttr {

clang/include/clang/Basic/AttrDocs.td

+25-11
Original file line numberDiff line numberDiff line change
@@ -2832,9 +2832,11 @@ def SYCLIntelFPGAInitiationIntervalAttrDocs : Documentation {
28322832
let Category = DocCatVariable;
28332833
let Heading = "intel::initiation_interval";
28342834
let Content = [{
2835-
This attribute applies to a loop. Indicates that the loop should be pipelined
2836-
with an initiation interval of N. N must be a positive integer. Cannot be
2837-
applied multiple times to the same loop.
2835+
This attribute applies to a loop or a function. Indicates that the loop or
2836+
function should be pipelined with an initiation interval of N. N must be a
2837+
positive integer. Cannot be applied multiple times to the same loop or function.
2838+
Cannot be used on the same loop or function in conjunction with
2839+
disable_loop_pipelining.
28382840

28392841
The ``[[intel::ii]]`` attribute spelling is a deprecated synonym for
28402842
``[[intel::initiation_interval]]`` and will be removed in the future.
@@ -2846,22 +2848,28 @@ The ``[[intel::ii]]`` attribute spelling is a deprecated synonym for
28462848
[[intel::initiation_interval(4)]] for (int i = 0; i < 10; ++i) var++;
28472849
}
28482850

2851+
[[intel::initiation_interval(4)]] void foo1 { }
2852+
28492853
template<int N>
28502854
void bar() {
28512855
[[intel::initiation_interval(N)]] for(;;) { }
28522856
}
28532857

2858+
template<int N>
2859+
[[intel::initiation_interval(N)]] void bar1 { }
2860+
28542861
}];
28552862
}
28562863

28572864
def SYCLIntelFPGAMaxConcurrencyAttrDocs : Documentation {
28582865
let Category = DocCatVariable;
28592866
let Heading = "intel::max_concurrency";
28602867
let Content = [{
2861-
This attribute applies to a loop. Indicates that the loop should allow no more
2862-
than N threads or iterations to execute it simultaneously. N must be a non
2863-
negative integer. '0' indicates the max_concurrency case to be unbounded. Cannot
2864-
be applied multiple times to the same loop.
2868+
This attribute applies to a loop or a function. It indicates that the
2869+
loop/function should allow no more than N threads or iterations to execute it
2870+
simultaneously. N must be a non negative integer. '0' indicates the
2871+
max_concurrency case to be unbounded. Cannot be applied multiple times to the
2872+
same loop.
28652873

28662874
.. code-block:: c++
28672875

@@ -2870,10 +2878,13 @@ be applied multiple times to the same loop.
28702878
[[intel::max_concurrency(2)]] for (int i = 0; i != 10; ++i) a[i] = 0;
28712879
}
28722880

2881+
[[intel::max_concurrency(2)]] void foo1 { }
28732882
template<int N>
28742883
void bar() {
28752884
[[intel::max_concurrency(N)]] for(;;) { }
28762885
}
2886+
template<int N>
2887+
[[intel::max_concurrency(N)]] void bar1() { }
28772888

28782889
}];
28792890
}
@@ -2921,10 +2932,11 @@ def SYCLIntelFPGADisableLoopPipeliningAttrDocs : Documentation {
29212932
let Category = DocCatVariable;
29222933
let Heading = "intel::disable_loop_pipelining";
29232934
let Content = [{
2924-
This attribute applies to a loop. Disables pipelining of the loop data path,
2925-
causing the loop to be executed serially. Cannot be used on the same loop in
2926-
conjunction with max_interleaving, speculated_iterations, max_concurrency, ii
2927-
or ivdep.
2935+
This attribute applies to a loop or a function. Takes no arguments and
2936+
disables pipelining of the loop or function data path, causing the loop
2937+
or function to be executed serially. Cannot be used on the same loop or
2938+
function in conjunction with max_interleaving, speculated_iterations,
2939+
max_concurrency, initiation_interval, or ivdep.
29282940

29292941
.. code-block:: c++
29302942

@@ -2933,6 +2945,8 @@ or ivdep.
29332945
[[intel::disable_loop_pipelining] for (int i = 0; i < 10; ++i) var++;
29342946
}
29352947

2948+
[[intel::disable_loop_pipelining] void foo1() { }
2949+
29362950
}];
29372951
}
29382952

clang/include/clang/Basic/DiagnosticSemaKinds.td

+2
Original file line numberDiff line numberDiff line change
@@ -11214,6 +11214,8 @@ def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit "
1121411214
"sizes greater than %1 not supported">;
1121511215
def err_esimd_glob_cant_init : Error<
1121611216
"SYCL explicit SIMD does not permit private global variable to have an initializer">;
11217+
def err_esimd_global_in_sycl_context : Error<
11218+
"ESIMD globals cannot be used in a SYCL context">;
1121711219

1121811220
def err_sycl_kernel_incorrectly_named : Error<"%0 is an invalid kernel name type">;
1121911221
def note_invalid_type_in_sycl_kernel : Note<

clang/include/clang/Basic/LangOptions.h

+3
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ class LangOptions : public LangOptionsBase {
350350
/// SYCL integration header to be generated by the device compiler
351351
std::string SYCLIntHeader;
352352

353+
/// SYCL integration footer to be generated by the device compiler
354+
std::string SYCLIntFooter;
355+
353356
LangOptions();
354357

355358
// Define accessors/mutators for language options of enumeration type.

clang/include/clang/Driver/Options.td

+5
Original file line numberDiff line numberDiff line change
@@ -5685,6 +5685,11 @@ def fsycl_int_header : Separate<["-"], "fsycl-int-header">,
56855685
MarshallingInfoString<LangOpts<"SYCLIntHeader">>;
56865686
def fsycl_int_header_EQ : Joined<["-"], "fsycl-int-header=">,
56875687
Alias<fsycl_int_header>;
5688+
def fsycl_int_footer : Separate<["-"], "fsycl-int-footer">,
5689+
HelpText<"Generate SYCL integration footer into this file.">,
5690+
MarshallingInfoString<LangOpts<"SYCLIntFooter">>;
5691+
def fsycl_int_footer_EQ : Joined<["-"], "fsycl-int-footer=">,
5692+
Alias<fsycl_int_footer>;
56885693
def fsycl_std_layout_kernel_params: Flag<["-"], "fsycl-std-layout-kernel-params">,
56895694
HelpText<"Enable standard layout requirement for SYCL kernel parameters.">,
56905695
MarshallingInfoFlag<LangOpts<"SYCLStdLayoutKernelParams">>;

0 commit comments

Comments
 (0)