Skip to content

Commit ee122ae

Browse files
dlei6gigcbot
authored andcommitted
Give name to functions with empty name strings
Functions with empty name strings can get mapped to the same label in vISA and cause functional issues. Always give it a name. LLVM will generate a unique tag if there are duplicates.
1 parent 68f38ec commit ee122ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ void LegalizeFunctionSignatures::FixFunctionSignatures(Module& M)
251251
if (isEntryFunc(pMdUtils, pFunc))
252252
continue;
253253

254+
if (pFunc->getName().empty())
255+
{
256+
// Empty function names can cause funny behavior later on
257+
// Always give it a name. If duplicates, LLVM will insert a unique tag
258+
pFunc->setName("__function__");
259+
}
260+
254261
// For binary linking, calling a function outside the module is possible, so declaration
255262
// signatures has to be fixed as well
256263
if (pFunc->isDeclaration() &&

0 commit comments

Comments
 (0)