Skip to content

Commit 1b35cf1

Browse files
aparshin-inteligcbot
authored andcommitted
workaround to preserve IR validity after CMImpParam pass
1 parent f38552b commit 1b35cf1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

IGC/VectorCompiler/lib/GenXOpts/CMTrans/CMImpParam.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ CallGraphNode *CMImpParam::ProcessKernel(Function *F) {
588588
F->getParent()->getFunctionList().insert(F->getIterator(), NF);
589589
NF->takeName(F);
590590
NF->setSubprogram(F->getSubprogram()); // tranfer debug-info
591+
// DISubprogram must be unique to the module.
592+
// Since F can be left as a "hanging" entity in the module - we preserve
593+
// IR correctness by detaching DISubprogram node from it
594+
F->setSubprogram(nullptr);
591595

592596
// Now to splice the body of the old function into the new function
593597
NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());

0 commit comments

Comments
 (0)