Skip to content

Commit 8aae3d3

Browse files
authored
[NFC][SYCL] Add todo comment for validation of group-local variables definintion (#3437)
Signed-off-by: Mikhail Lychkov <mikhail.lychkov@intel.com>
1 parent 6f0ad1a commit 8aae3d3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/lib/SYCLLowerIR/LowerWGLocalMemory.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ ModulePass *llvm::createSYCLLowerWGLocalMemoryLegacyPass() {
5252
return new SYCLLowerWGLocalMemoryLegacy();
5353
}
5454

55-
// Static local memory allocation should be allowed only in a scope of a kernel
56-
// (not a device function) and shouldn't be called inside loop or if statement
55+
// TODO: It should be checked that __sycl_allocateLocalMemory (or its source
56+
// form - group_local_memory) does not occur:
57+
// - in a function (other than user lambda/functor)
58+
// - in a loop
59+
// - in a non-convergent control flow
5760
// to make it consistent with OpenCL restriction.
58-
// TODO: Relax that restriction for SYCL or modify this pass to move allocation
59-
// of memory up to a kernel scope at the beginning for each nested device
60-
// function call, loop or if statement.
61+
// But LLVM pass is not the best place to diagnose these cases.
62+
// Error checking should be done in the front-end compiler.
6163
static void lowerAllocaLocalMemCall(CallInst *CI, Module &M) {
6264
assert(CI);
6365

0 commit comments

Comments
 (0)