-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] [FPGA] Disable swapping dimension values of WorkGroupAttr arguments for semantic checks #2962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] [FPGA] Disable swapping dimension values of WorkGroupAttr arguments for semantic checks #2962
Conversation
…or semantic checks This is a followup comments on intel#2906 (comment) and intel#2906 (comment). Currently For a SYCLDevice WorkGroupAttr arguments are reversed. if (S.getLangOpts().SYCLIsDevice) std::swap(XDimExpr, ZDimExpr); There are few problems with this approach (swapping order in AST): 1. A user who writes the order as X, Y, Z in their source will get Z, Y, X when they pretty print the AST. 2. The same will happen when dumping the AST to text or JSON or generating diagnostic messages since the fist and third arguments of WorkGroupAttr are reversed. 3. This is very confusing to see the different order than the oroginal source codes. max_work_group_size() follows same rules as reqd_work_group_size() in Sema and LLVM IR generation. This patch keeps the arguments in the same order as they were parsed in doing semantic checks, and when performing code generation, we would change the argument order when lowering to LLVM IR and not when creating the semantic attribute. Signed-off-by: Soumi Manna <soumi.manna@intel.com>
could you please review @Fznamznon? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to hear from @AaronBallman here as well, but for me it looks fine.
Thanks Mariya. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from a very minor nit that can be fixed in one of the tests.
@@ -94,13 +94,13 @@ int main() { | |||
h.single_task<class test_kernel5>(TRIFuncObjGood2()); | |||
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel5 | |||
// CHECK: ReqdWorkGroupSizeAttr {{.*}} | |||
// // CHECK-NEXT: IntegerLiteral{{.*}}1{{$}} | |||
// // CHECK-NEXT: IntegerLiteral{{.*}}4{{$}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the duplicate //
comment token. Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Sorry for the duplicate comments. Thanks @AaronBallman.
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
d4581c3
Thank you everyone for the reviews. |
…work_group_size attributes This patch 1. fixes typo 2. removes redundant comments (we have disabled swapping dimension values of WorkGroupAttr arguments for semantic checks on intel#2962) 3. Hoist the logic from the second if into the above if (AttrValue == 0) Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Update for llvm-project commit abba01a ("[ADT] Deprecate PointerUnion::{is,get} (NFC) (#122623)", 2025-01-13). Original commit: KhronosGroup/SPIRV-LLVM-Translator@c8e8867efd44034
This is a followup comments on #2906 (comment)
and #2906 (comment).
Currently for a SYCLDevice, first and third argument of WorkGroupAttr
are reversed in doing semantic checks as wells as code generation.
There are few problems with this approach (swapping order in AST):
they pretty print the AST.
generating diagnostic messages since the fist and third arguments of
WorkGroupAttr are reversed.
source codes for Semantic checks.
max_work_group_size() follows same rules as reqd_work_group_size() in Sema and LLVM IR generation.
This patch keeps the arguments in the same order as they were parsed in doing semantic checks,
and when performing code generation, we would change the argument order when lowering to
LLVM IR and not when creating the semantic attribute.
Signed-off-by: Soumi Manna soumi.manna@intel.com