Repository navigation
[SYCL] Fix indirect hier-par not marking intermediate functions. - #23765
Open
inteltdelisle wants to merge 4 commits into
Open
inteltdelisle wants to merge 4 commits into
inteltdelisle wants to merge 4 commits into
Conversation
Code inside parallel_for_work_group(pfwg) must be lowered so that the side-effects only happen on the leader. However, some functions must not be called on divergent control flow, particularly parallel_for_work_item(pfwi). Previously, calls to pfwi tagged the caller as needing lowering, but the rest of the call-stack was not tagged. This could duplicate side-effects in intermediate functions. This changes the tagging to mark the entire stack. Fixes intel#23700. Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
Contributor
Author
|
Ping @intel/dpcpp-cfe-reviewers @intel/dpcpp-tools-reviewers @intel/llvm-reviewers-runtime |
uditagarwal97
approved these changes
Nov 13, 2026
Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
| // A helper which does not reach parallel_for_work_item is not marked: | ||
| // CHECK-DAG: define {{.*}}spir_func void @_Z5plainPi({{.*}}) #{{[0-9]+}} {{[{]$}} | ||
|
|
||
| // The SYCL kernel function is not emitted in device IR, so check its AST |
Contributor
There was a problem hiding this comment.
You don't need this test. I think the KERNEL check above is sufficient. Sorry I gave an incorrect answer earlier in chat.
Also, AST tests should never be added in a CodeGen file. This however did remind me that you should add a Sema test for this PR. Can you check if scope attribute has an existing Sema or AST test? Can you add tests for this PR there?
Contributor
Author
There was a problem hiding this comment.
I tried to address this. But I admit I wasn't exactly sure what you were looking for so I relied on Claude much more heavily. Do my changes in 1f21d1f address your concerns?
Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code inside parallel_for_work_group(pfwg) must be lowered so that the side-effects only happen on the leader. However, some functions must not be called on divergent control flow, particularly parallel_for_work_item(pfwi). Previously, calls to pfwi tagged the caller as needing lowering, but the rest of the call-stack was not tagged. This could duplicate side-effects in intermediate functions. This changes the tagging to mark the entire stack.
Fixes #23700.