You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Refactor of FPGA loop fusion function attributes
This patch
1. refactors two function attributes using intel#3224 :
[[intel::loop_fuse()]] and [[intel::loop_fuse_independent()]]
2. store expression as ConstantExpr in Semantic Attributes
3. handles template instantiations properly for duplicate attributes on a given declaration.
4. adds test
5. updates codegen codes
Signed-off-by: Soumi Manna <[email protected]>
Copy file name to clipboardExpand all lines: clang/test/SemaSYCL/loop_fusion.cpp
+31-7Lines changed: 31 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
[[intel::loop_fuse(5)]] int a; // expected-error{{'loop_fuse' attribute only applies to functions}}
4
4
5
-
[[intel::loop_fuse("foo")]] voidfunc() {} // expected-error{{'loop_fuse' attribute requires an integer constant}}
5
+
[[intel::loop_fuse("foo")]] voidfunc() {} // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'const char [4]'}}
6
6
7
7
[[intel::loop_fuse(1048577)]] voidfunc1() {} // OK
8
8
[[intel::loop_fuse_independent(-1)]] voidfunc2() {} // expected-error{{'loop_fuse_independent' attribute requires a non-negative integral compile time constant expression}}
[[intel::loop_fuse]] [[intel::loop_fuse(10)]] voidfunc7() {} // expected-warning {{attribute 'loop_fuse' is already applied with different arguments}}
18
-
[[intel::loop_fuse_independent(5)]] [[intel::loop_fuse_independent(10)]] voidfunc8() {} // expected-warning {{attribute 'loop_fuse_independent' is already applied with different arguments}}
17
+
[[intel::loop_fuse]] // expected-note {{previous attribute is here}}
18
+
[[intel::loop_fuse(10)]] voidfunc7() {} // expected-warning {{attribute 'loop_fuse' is already applied with different arguments}}
19
+
20
+
[[intel::loop_fuse_independent(5)]] // expected-note {{previous attribute is here}}
21
+
[[intel::loop_fuse_independent(10)]] voidfunc8() {} // expected-warning {{attribute 'loop_fuse_independent' is already applied with different arguments}}
[[intel::loop_fuse(1)]] voidfunc11();// expected-note {{previous attribute is here}}
27
30
[[intel::loop_fuse(3)]] voidfunc11(); // expected-warning {{attribute 'loop_fuse' is already applied with different arguments}}
28
31
29
-
[[intel::loop_fuse_independent(1)]] voidfunc12();
32
+
[[intel::loop_fuse_independent(1)]] voidfunc12();// expected-note {{previous attribute is here}}
30
33
[[intel::loop_fuse_independent(3)]] voidfunc12(); // expected-warning {{attribute 'loop_fuse_independent' is already applied with different arguments}}
31
34
32
35
// expected-error@+2 {{'loop_fuse_independent' and 'loop_fuse' attributes are not compatible}}
@@ -51,13 +54,34 @@ template <int N>
51
54
[[intel::loop_fuse(N)]] voidfunc17(); // expected-error{{'loop_fuse' attribute requires a non-negative integral compile time constant expression}}
52
55
53
56
template <typename Ty>
54
-
[[intel::loop_fuse(Ty{})]] voidfunc18() {} // expected-error{{'loop_fuse' attribute requires an integer constant}}
57
+
[[intel::loop_fuse(Ty{})]] voidfunc18() {} // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'float'}}
58
+
59
+
template <int size>
60
+
[[intel::loop_fuse(12)]] voidfunc19(); // expected-note {{previous attribute is here}}
61
+
template <int size>
62
+
[[intel::loop_fuse(size)]] voidfunc19() {} // expected-warning {{attribute 'loop_fuse' is already applied with different arguments}}
63
+
64
+
template <int size>
65
+
[[intel::loop_fuse_independent(5)]] voidfunc20(); // expected-note {{previous attribute is here}}
66
+
template <int size>
67
+
[[intel::loop_fuse_independent(size)]] voidfunc20() {} // expected-warning {{attribute 'loop_fuse_independent' is already applied with different arguments}}
[[intel::loop_fuse_independent]] // expected-note {{previous attribute is here}}
87
+
[[intel::loop_fuse_independent(10)]] voidfunc23() {} // expected-warning {{attribute 'loop_fuse_independent' is already applied with different arguments}}
0 commit comments