Skip to content

Commit f71f7e9

Browse files
committed
[SYCL] Skip processKernel for declarations in LocalAccessorToSharedMemory
ed022d9 start to enable partitions in LTO. So the input IR to LocalAccessorToSharedMemory might contains delarations only, we should skip such functions. Or else we will get into assertsions or segv when getting entryblock.
1 parent 8679826 commit f71f7e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/SYCLLowerIR/LocalAccessorToSharedMemory.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ LocalAccessorToSharedMemoryPass::run(Module &M, ModuleAnalysisManager &) {
8686

8787
Function *LocalAccessorToSharedMemoryPass::processKernel(Module &M,
8888
Function *F) {
89+
if (F->isDeclaration())
90+
return nullptr;
91+
8992
// Check if this function is eligible by having an argument that uses shared
9093
// memory.
9194
const bool UsesLocalMemory =

0 commit comments

Comments
 (0)