From 2fa6c7b2ab096d0035407fd80f553c651af1a4ca Mon Sep 17 00:00:00 2001 From: Soumi Manna Date: Thu, 8 Apr 2021 05:49:44 -0700 Subject: [PATCH 1/5] Add mutual diagnostic of max_concurrency attribute in conjunction of disable_loop_pipelining attribute The support for disable_loop_pipelining was implemented on https://github.com/intel/llvm/pull/3441 This patch 1. removes FIXME 2. Updtaes document 3. adds tests 4. fixes typos Signed-off-by: Soumi Manna --- clang/include/clang/Basic/AttrDocs.td | 6 ++-- clang/lib/Sema/SemaDeclAttr.cpp | 29 +++++++++++-------- .../CodeGenSYCL/disable_loop_pipelining.cpp | 7 ++--- .../test/CodeGenSYCL/initiation_interval.cpp | 9 +++--- clang/test/SemaSYCL/initiation_interval.cpp | 6 ++-- clang/test/SemaSYCL/max-concurrency.cpp | 14 +++++++++ 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index 25660bca2050e..70792fc7e04b0 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -2869,7 +2869,7 @@ This attribute applies to a loop or a function. It indicates that the loop/function should allow no more than N threads or iterations to execute it simultaneously. N must be a non negative integer. '0' indicates the max_concurrency case to be unbounded. Cannot be applied multiple times to the -same loop. +same loop or function in conjunction with disable_loop_pipelining. .. code-block:: c++ @@ -2942,10 +2942,10 @@ max_concurrency, initiation_interval, or ivdep. void foo() { int var = 0; - [[intel::disable_loop_pipelining] for (int i = 0; i < 10; ++i) var++; + [[intel::disable_loop_pipelining]] for (int i = 0; i < 10; ++i) var++; } - [[intel::disable_loop_pipelining] void foo1() { } + [[intel::disable_loop_pipelining]] void foo1() { } }]; } diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index f007d9470a635..a73061eec5b5a 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3313,6 +3313,11 @@ static void handleSYCLIntelFPGADisableLoopPipeliningAttr(Sema &S, Decl *D, if (checkAttrMutualExclusion(S, D, A)) return; + // [[intel::disable_loop_pipelining] and [[intel::max_concurrency()]] + // attributes are incompatible. + if (checkAttrMutualExclusion(S, D, A)) + return; + D->addAttr(::new (S.Context) SYCLIntelFPGADisableLoopPipeliningAttr(S.Context, A)); } @@ -6367,12 +6372,12 @@ SYCLIntelFPGAMaxConcurrencyAttr *Sema::MergeSYCLIntelFPGAMaxConcurrencyAttr( } return nullptr; } - // FIXME - // max_concurrency and disable_component_pipelining attributes can't be - // applied to the same function. Upcoming patch needs to have this code - // added to it: - // if (checkAttrMutualExclusion(S, D, AL)) - // return; + + // [[intel::max_concurrency()]] and [[intel::disable_loop_pipelining] + // attributes are incompatible. + if (checkAttrMutualExclusion(*this, D, + A)) + return nullptr; return ::new (Context) SYCLIntelFPGAMaxConcurrencyAttr(Context, A, A.getNThreadsExpr()); @@ -6406,18 +6411,18 @@ void Sema::AddSYCLIntelFPGAMaxConcurrencyAttr(Decl *D, } } + // [[intel::disable_loop_pipelining] and [[intel::max_concurrency()]] + // attributes are incompatible. + if (checkAttrMutualExclusion(*this, D, + CI)) + return; + D->addAttr(::new (Context) SYCLIntelFPGAMaxConcurrencyAttr(Context, CI, E)); } static void handleSYCLIntelFPGAMaxConcurrencyAttr(Sema &S, Decl *D, const ParsedAttr &A) { S.CheckDeprecatedSYCLAttributeSpelling(A); - // FIXME - // max_concurrency and disable_component_pipelining attributes can't be - // applied to the same function. Upcoming patch needs to have this code - // added to it: - // if (checkAttrMutualExclusion(S, D, AL)) - // return; Expr *E = A.getArgAsExpr(0); S.AddSYCLIntelFPGAMaxConcurrencyAttr(D, A, E); diff --git a/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp b/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp index 33f83f6b1961f..85c51b090616c 100644 --- a/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp +++ b/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp @@ -29,8 +29,7 @@ int main() { return 0; } -// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel1"() #0 !kernel_arg_buffer_location ![[NUM4:[0-9]+]] !disable_loop_pipelining ![[NUM5:[0-9]+]] -// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel2"() #0 !kernel_arg_buffer_location ![[NUM4]] -// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel3"() #0 !kernel_arg_buffer_location ![[NUM4]] !disable_loop_pipelining ![[NUM5]] -// CHECK: ![[NUM4]] = !{} +// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel1"() #0 {{.*}} !disable_loop_pipelining ![[NUM5:[0-9]+]] +// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel2"() #0 {{.*}} +// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel3"() #0 {{.*}} !disable_loop_pipelining ![[NUM5]] // CHECK: ![[NUM5]] = !{i32 1} diff --git a/clang/test/CodeGenSYCL/initiation_interval.cpp b/clang/test/CodeGenSYCL/initiation_interval.cpp index 95ef9ce4cde50..b32cbb037f2ff 100644 --- a/clang/test/CodeGenSYCL/initiation_interval.cpp +++ b/clang/test/CodeGenSYCL/initiation_interval.cpp @@ -39,11 +39,10 @@ int main() { return 0; } -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name1"() #0 !kernel_arg_buffer_location ![[NUM0:[0-9]+]] !initiation_interval ![[NUM1:[0-9]+]] -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 !kernel_arg_buffer_location ![[NUM0]] !initiation_interval ![[NUM42:[0-9]+]] -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 !kernel_arg_buffer_location ![[NUM0]] !initiation_interval ![[NUM2:[0-9]+]] -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 !kernel_arg_buffer_location ![[NUM0]] -// CHECK: ![[NUM0]] = !{} +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name1"() #0 {{.*}} !initiation_interval ![[NUM1:[0-9]+]] +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 {{.*}} !initiation_interval ![[NUM42:[0-9]+]] +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 {{.*}} !initiation_interval ![[NUM2:[0-9]+]] +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 {{.*}} // CHECK: ![[NUM1]] = !{i32 1} // CHECK: ![[NUM42]] = !{i32 42} // CHECK: ![[NUM2]] = !{i32 2} diff --git a/clang/test/SemaSYCL/initiation_interval.cpp b/clang/test/SemaSYCL/initiation_interval.cpp index cc0dafc2f1a4f..10ff6b890ff15 100644 --- a/clang/test/SemaSYCL/initiation_interval.cpp +++ b/clang/test/SemaSYCL/initiation_interval.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsycl-is-device -verify %s -// Test that checks disable_loop_pipelining attribute support on Function. +// Test that checks initiation_interval attribute support on function. // Tests for incorrect argument values for Intel FPGA initiation_interval function attribute. +[[intel::initiation_interval]] void one() {} // expected-error {{'initiation_interval' attribute takes one argument}} + [[intel::initiation_interval(5)]] int a; // expected-error{{'initiation_interval' attribute only applies to 'for', 'while', 'do' statements, and functions}} [[intel::initiation_interval("foo")]] void func() {} // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'const char [4]'}} @@ -27,7 +29,7 @@ [[intel::initiation_interval(1)]] void func6(); // expected-note {{previous attribute is here}} [[intel::initiation_interval(3)]] void func6(); // expected-warning {{attribute 'initiation_interval' is already applied with different arguments}} -// Tests for Intel FPGA loop fusion function attributes compatibility +// Tests for Intel FPGA initiation_interval and disable_loop_pipelining function attributes compatibility. // expected-error@+2 {{'initiation_interval' and 'disable_loop_pipelining' attributes are not compatible}} // expected-note@+1 {{conflicting attribute is here}} [[intel::disable_loop_pipelining]] [[intel::initiation_interval(2)]] void func7(); diff --git a/clang/test/SemaSYCL/max-concurrency.cpp b/clang/test/SemaSYCL/max-concurrency.cpp index 73d7bf5011f52..49cf4abe5ac39 100644 --- a/clang/test/SemaSYCL/max-concurrency.cpp +++ b/clang/test/SemaSYCL/max-concurrency.cpp @@ -16,6 +16,20 @@ class Functor1 { [[intel::max_concurrency]] void foo() {} // expected-error {{'max_concurrency' attribute takes one argument}} +// Tests for Intel FPGA max_concurrency and disable_loop_pipelining function attributes compatibility. +// expected-error@+2 {{'max_concurrency' and 'disable_loop_pipelining' attributes are not compatible}} +// expected-note@+1 {{conflicting attribute is here}} +[[intel::disable_loop_pipelining]] [[intel::max_concurrency(2)]] void check(); + +// expected-error@+2 {{'disable_loop_pipelining' and 'max_concurrency' attributes are not compatible}} +// expected-note@+1 {{conflicting attribute is here}} +[[intel::max_concurrency(4)]] [[intel::disable_loop_pipelining]] void check1(); + +// expected-error@+2 {{'max_concurrency' and 'disable_loop_pipelining' attributes are not compatible}} +// expected-note@+2 {{conflicting attribute is here}} +[[intel::max_concurrency(4)]] void check2(); +[[intel::disable_loop_pipelining]] void check2(); + class Functor2 { public: void operator()() const { From d68b060fb12fc03cbadc51feeaaed99ae1ad50e6 Mon Sep 17 00:00:00 2001 From: Soumi Manna Date: Thu, 8 Apr 2021 11:34:27 -0700 Subject: [PATCH 2/5] address review comments Signed-off-by: Soumi Manna --- clang/include/clang/Basic/Attr.td | 3 +++ clang/include/clang/Basic/AttrDocs.td | 11 ++++++----- clang/lib/Sema/SemaDeclAttr.cpp | 17 ----------------- clang/test/SemaSYCL/max-concurrency.cpp | 4 ++-- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 50cd50e619371..265b18dd12bf7 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -1951,6 +1951,9 @@ def SYCLIntelFPGADisableLoopPipelining : DeclOrStmtAttr { let SupportsNonconformingLambdaSyntax = 1; } +def : MutualExclusions<[SYCLIntelFPGAInitiationInterval, + SYCLIntelFPGADisableLoopPipelining]>; + def SYCLIntelFPGAMaxInterleaving : StmtAttr { let Spellings = [CXX11<"intelfpga","max_interleaving">, CXX11<"intel","max_interleaving">]; diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index 70792fc7e04b0..66feed2cc10ff 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -2835,8 +2835,8 @@ def SYCLIntelFPGAInitiationIntervalAttrDocs : Documentation { This attribute applies to a loop or a function. Indicates that the loop or function should be pipelined with an initiation interval of N. N must be a positive integer. Cannot be applied multiple times to the same loop or function. -Cannot be used on the same loop or function in conjunction with -disable_loop_pipelining. +Cannot be used on the same loop or function, or in conjunction with +``disable_loop_pipelining``. The ``[[intel::ii]]`` attribute spelling is a deprecated synonym for ``[[intel::initiation_interval]]`` and will be removed in the future. @@ -2869,7 +2869,7 @@ This attribute applies to a loop or a function. It indicates that the loop/function should allow no more than N threads or iterations to execute it simultaneously. N must be a non negative integer. '0' indicates the max_concurrency case to be unbounded. Cannot be applied multiple times to the -same loop or function in conjunction with disable_loop_pipelining. +same loop or function, or in conjunction with ``disable_loop_pipelining``. .. code-block:: c++ @@ -2935,8 +2935,9 @@ def SYCLIntelFPGADisableLoopPipeliningAttrDocs : Documentation { This attribute applies to a loop or a function. Takes no arguments and disables pipelining of the loop or function data path, causing the loop or function to be executed serially. Cannot be used on the same loop or -function in conjunction with max_interleaving, speculated_iterations, -max_concurrency, initiation_interval, or ivdep. +function, or in conjunction with ``max_interleaving``, +``speculated_iterations``, ``max_concurrency``, ``initiation_interval``, +or ``ivdep``. .. code-block:: c++ diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index a73061eec5b5a..3456a9a9e3f48 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3313,11 +3313,6 @@ static void handleSYCLIntelFPGADisableLoopPipeliningAttr(Sema &S, Decl *D, if (checkAttrMutualExclusion(S, D, A)) return; - // [[intel::disable_loop_pipelining] and [[intel::max_concurrency()]] - // attributes are incompatible. - if (checkAttrMutualExclusion(S, D, A)) - return; - D->addAttr(::new (S.Context) SYCLIntelFPGADisableLoopPipeliningAttr(S.Context, A)); } @@ -6373,12 +6368,6 @@ SYCLIntelFPGAMaxConcurrencyAttr *Sema::MergeSYCLIntelFPGAMaxConcurrencyAttr( return nullptr; } - // [[intel::max_concurrency()]] and [[intel::disable_loop_pipelining] - // attributes are incompatible. - if (checkAttrMutualExclusion(*this, D, - A)) - return nullptr; - return ::new (Context) SYCLIntelFPGAMaxConcurrencyAttr(Context, A, A.getNThreadsExpr()); } @@ -6411,12 +6400,6 @@ void Sema::AddSYCLIntelFPGAMaxConcurrencyAttr(Decl *D, } } - // [[intel::disable_loop_pipelining] and [[intel::max_concurrency()]] - // attributes are incompatible. - if (checkAttrMutualExclusion(*this, D, - CI)) - return; - D->addAttr(::new (Context) SYCLIntelFPGAMaxConcurrencyAttr(Context, CI, E)); } diff --git a/clang/test/SemaSYCL/max-concurrency.cpp b/clang/test/SemaSYCL/max-concurrency.cpp index f99191d5602d4..d279f7f30fdc6 100644 --- a/clang/test/SemaSYCL/max-concurrency.cpp +++ b/clang/test/SemaSYCL/max-concurrency.cpp @@ -25,8 +25,8 @@ class Functor1 { // expected-note@+1 {{conflicting attribute is here}} [[intel::max_concurrency(4)]] [[intel::disable_loop_pipelining]] void check1(); -// expected-error@+2 {{'max_concurrency' and 'disable_loop_pipelining' attributes are not compatible}} -// expected-note@+2 {{conflicting attribute is here}} +// expected-error@+3 {{'max_concurrency' and 'disable_loop_pipelining' attributes are not compatible}} +// expected-note@+1 {{conflicting attribute is here}} [[intel::max_concurrency(4)]] void check2(); [[intel::disable_loop_pipelining]] void check2(); From fd8a417f895e71bc224dcfca8db2d8205f0ca355 Mon Sep 17 00:00:00 2001 From: Soumi Manna Date: Thu, 8 Apr 2021 12:22:50 -0700 Subject: [PATCH 3/5] fix build failure and warning issues Signed-off-by: Soumi Manna --- clang/include/clang/Basic/Attr.td | 2 +- clang/utils/TableGen/ClangAttrEmitter.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index bb34f75c24774..cd6fcd04c9166 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -1953,7 +1953,7 @@ def SYCLIntelFPGADisableLoopPipelining : DeclOrStmtAttr { def : MutualExclusions<[SYCLIntelFPGAInitiationInterval, SYCLIntelFPGADisableLoopPipelining]>; -def : MutualExclusions<[SYCLIntelFPGAInitiationInterval, +def : MutualExclusions<[SYCLIntelFPGAMaxConcurrency, SYCLIntelFPGADisableLoopPipelining]>; def SYCLIntelFPGAMaxInterleaving : StmtAttr { diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index 30f1ea103c902..98b695c4464a2 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -3694,6 +3694,11 @@ static void GenerateMutualExclusionsChecks(const Record &Attr, } } + // If there are any decl or stmt attributes, silence -Woverloaded-virtual + // warnings for them both. + if (!DeclAttrs.empty() || !StmtAttrs.empty()) + OS << " using ParsedAttrInfo::diagMutualExclusion;\n\n"; + // If we discovered any decl or stmt attributes to test for, generate the // predicates for them now. if (!DeclAttrs.empty()) { From a1acc29b1d2517e2485bf474e93756ac72a0d885 Mon Sep 17 00:00:00 2001 From: Soumi Manna Date: Thu, 8 Apr 2021 12:44:16 -0700 Subject: [PATCH 4/5] Fix Lit test failure due to merge Signed-off-by: Soumi Manna --- clang/test/SemaSYCL/max-concurrency.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/SemaSYCL/max-concurrency.cpp b/clang/test/SemaSYCL/max-concurrency.cpp index d279f7f30fdc6..a10045413711b 100644 --- a/clang/test/SemaSYCL/max-concurrency.cpp +++ b/clang/test/SemaSYCL/max-concurrency.cpp @@ -25,7 +25,7 @@ class Functor1 { // expected-note@+1 {{conflicting attribute is here}} [[intel::max_concurrency(4)]] [[intel::disable_loop_pipelining]] void check1(); -// expected-error@+3 {{'max_concurrency' and 'disable_loop_pipelining' attributes are not compatible}} +// expected-error@+3 {{'disable_loop_pipelining' and 'max_concurrency' attributes are not compatible}} // expected-note@+1 {{conflicting attribute is here}} [[intel::max_concurrency(4)]] void check2(); [[intel::disable_loop_pipelining]] void check2(); From 137f83ca67a2145b56a3a41ebf324885fa3b043c Mon Sep 17 00:00:00 2001 From: Soumi Manna Date: Thu, 8 Apr 2021 13:42:34 -0700 Subject: [PATCH 5/5] remove unrealted chnages Signed-off-by: Soumi Manna --- clang/include/clang/Basic/AttrDocs.td | 4 ++-- clang/test/CodeGenSYCL/disable_loop_pipelining.cpp | 7 ++++--- clang/test/CodeGenSYCL/initiation_interval.cpp | 9 +++++---- clang/test/SemaSYCL/initiation_interval.cpp | 6 ++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index 66feed2cc10ff..0dd0a9003ccdd 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -2835,8 +2835,8 @@ def SYCLIntelFPGAInitiationIntervalAttrDocs : Documentation { This attribute applies to a loop or a function. Indicates that the loop or function should be pipelined with an initiation interval of N. N must be a positive integer. Cannot be applied multiple times to the same loop or function. -Cannot be used on the same loop or function, or in conjunction with -``disable_loop_pipelining``. +Cannot be used on the same loop or function in conjunction with +disable_loop_pipelining. The ``[[intel::ii]]`` attribute spelling is a deprecated synonym for ``[[intel::initiation_interval]]`` and will be removed in the future. diff --git a/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp b/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp index 85c51b090616c..33f83f6b1961f 100644 --- a/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp +++ b/clang/test/CodeGenSYCL/disable_loop_pipelining.cpp @@ -29,7 +29,8 @@ int main() { return 0; } -// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel1"() #0 {{.*}} !disable_loop_pipelining ![[NUM5:[0-9]+]] -// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel2"() #0 {{.*}} -// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel3"() #0 {{.*}} !disable_loop_pipelining ![[NUM5]] +// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel1"() #0 !kernel_arg_buffer_location ![[NUM4:[0-9]+]] !disable_loop_pipelining ![[NUM5:[0-9]+]] +// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel2"() #0 !kernel_arg_buffer_location ![[NUM4]] +// CHECK: define dso_local spir_kernel void @"{{.*}}test_kernel3"() #0 !kernel_arg_buffer_location ![[NUM4]] !disable_loop_pipelining ![[NUM5]] +// CHECK: ![[NUM4]] = !{} // CHECK: ![[NUM5]] = !{i32 1} diff --git a/clang/test/CodeGenSYCL/initiation_interval.cpp b/clang/test/CodeGenSYCL/initiation_interval.cpp index b32cbb037f2ff..95ef9ce4cde50 100644 --- a/clang/test/CodeGenSYCL/initiation_interval.cpp +++ b/clang/test/CodeGenSYCL/initiation_interval.cpp @@ -39,10 +39,11 @@ int main() { return 0; } -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name1"() #0 {{.*}} !initiation_interval ![[NUM1:[0-9]+]] -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 {{.*}} !initiation_interval ![[NUM42:[0-9]+]] -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 {{.*}} !initiation_interval ![[NUM2:[0-9]+]] -// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 {{.*}} +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name1"() #0 !kernel_arg_buffer_location ![[NUM0:[0-9]+]] !initiation_interval ![[NUM1:[0-9]+]] +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 !kernel_arg_buffer_location ![[NUM0]] !initiation_interval ![[NUM42:[0-9]+]] +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 !kernel_arg_buffer_location ![[NUM0]] !initiation_interval ![[NUM2:[0-9]+]] +// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 !kernel_arg_buffer_location ![[NUM0]] +// CHECK: ![[NUM0]] = !{} // CHECK: ![[NUM1]] = !{i32 1} // CHECK: ![[NUM42]] = !{i32 42} // CHECK: ![[NUM2]] = !{i32 2} diff --git a/clang/test/SemaSYCL/initiation_interval.cpp b/clang/test/SemaSYCL/initiation_interval.cpp index 0f45ed6617f42..e70360828276d 100644 --- a/clang/test/SemaSYCL/initiation_interval.cpp +++ b/clang/test/SemaSYCL/initiation_interval.cpp @@ -1,10 +1,8 @@ // RUN: %clang_cc1 -fsycl-is-device -verify %s -// Test that checks initiation_interval attribute support on function. +// Test that checks disable_loop_pipelining attribute support on Function. // Tests for incorrect argument values for Intel FPGA initiation_interval function attribute. -[[intel::initiation_interval]] void one() {} // expected-error {{'initiation_interval' attribute takes one argument}} - [[intel::initiation_interval(5)]] int a; // expected-error{{'initiation_interval' attribute only applies to 'for', 'while', 'do' statements, and functions}} [[intel::initiation_interval("foo")]] void func() {} // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'const char [4]'}} @@ -29,7 +27,7 @@ [[intel::initiation_interval(1)]] void func6(); // expected-note {{previous attribute is here}} [[intel::initiation_interval(3)]] void func6(); // expected-warning {{attribute 'initiation_interval' is already applied with different arguments}} -// Tests for Intel FPGA initiation_interval and disable_loop_pipelining function attributes compatibility. +// Tests for Intel FPGA loop fusion function attributes compatibility // expected-error@+2 {{'initiation_interval' and 'disable_loop_pipelining' attributes are not compatible}} // expected-note@+1 {{conflicting attribute is here}} [[intel::disable_loop_pipelining]] [[intel::initiation_interval(2)]] void func7();