Skip to content

Commit 5a99c82

Browse files
authored
[SYCL][NativeCPU][NFC] Prevent generating unnamed functions (#17707)
When we rename wrapper functions to take the name of the original, that leaves in place a call to the original meaning the original cannot be removed. When we take its name, the original's name would be cleared. Append ".orig" instead to make it easier to keep track of which is which.
1 parent 8dd0613 commit 5a99c82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/SYCLNativeCPUUtils/PrepareSYCLNativeCPU.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ PreservedAnalyses PrepareSYCLNativeCPUPass::run(Module &M,
365365
OldF->takeName(OrigF);
366366
if (OrigF->use_empty()) {
367367
RemovableFuncs.insert(OrigF);
368+
} else {
369+
OrigF->setName(Name + ".orig");
368370
}
369371
} else {
370372
OldF->setName(Name);

0 commit comments

Comments
 (0)