Skip to content

Commit 8350829

Browse files
committed
Remove calling conv assertion check
Signed-off-by: Mikhail Lychkov <[email protected]>
1 parent 4f34903 commit 8350829

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

llvm/lib/SYCLLowerIR/LowerWGLocalMemory.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,15 @@ 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
57+
// 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.
5561
static void lowerAllocaLocalMemCall(CallInst *CI, Module &M) {
5662
assert(CI);
5763

58-
// Static local memory allocation should be allowed only in a scope of a spir
59-
// kernel (not a spir function) to make it consistent with OpenCL restriction.
60-
// However, __sycl_allocateLocalMemory is invoked in a scope of kernel lambda
61-
// call operator, which is technically not a SPIR-V kernel scope.
62-
// TODO: Relax that restriction for SYCL or modify this pass to move
63-
// allocation of memory up to a spir kernel scope for each nested device
64-
// function call.
65-
CallingConv::ID CC = CI->getCaller()->getCallingConv();
66-
assert((CC == llvm::CallingConv::SPIR_FUNC ||
67-
CC == llvm::CallingConv::SPIR_KERNEL) &&
68-
"WG static local memory can be allocated only in kernel scope");
69-
7064
Value *ArgSize = CI->getArgOperand(0);
7165
uint64_t Size = cast<llvm::ConstantInt>(ArgSize)->getZExtValue();
7266
Value *ArgAlign = CI->getArgOperand(1);

0 commit comments

Comments
 (0)