Skip to content

Commit cc7a5e4

Browse files
Rishipal Singh Bhatiagfxbot
authored andcommitted
Whenever a function is cloned or erased, the old framework's metadata is
modified. We must replicate that modification in the new framework as well. Change-Id: I13201c6decb922da082810bf1d9f1ab033b59948
1 parent c4173af commit cc7a5e4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

IGC/Compiler/MetaDataApi/PurgeMetaDataUtils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ bool PurgeMetaDataUtils::runOnModule(Module &M)
108108
{
109109
pMdUtils->eraseFunctionsInfoItem(Iter);
110110
}
111-
}
111+
112+
if (pContext->getModuleMetaData()->FuncMD.find(F) != pContext->getModuleMetaData()->FuncMD.end())
113+
{
114+
pContext->getModuleMetaData()->FuncMD.erase(F);
115+
}
116+
}
112117

113118
// Update when there is any change.
114119
if (!ToBeDeleted.empty())

IGC/Compiler/Optimizer/PreCompiledFuncImport.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,12 @@ void PreCompiledFuncImport::createFuncWithIA()
14601460
m_pMdUtils->setFunctionsInfoItem(pNewFunc, oldFuncIter->second);
14611461
m_pMdUtils->eraseFunctionsInfoItem(oldFuncIter);
14621462

1463+
if (m_pCtx->getModuleMetaData()->FuncMD.find(pFunc) != m_pCtx->getModuleMetaData()->FuncMD.end())
1464+
{
1465+
m_pCtx->getModuleMetaData()->FuncMD[pNewFunc] = m_pCtx->getModuleMetaData()->FuncMD[pFunc];
1466+
m_pCtx->getModuleMetaData()->FuncMD.erase(pFunc);
1467+
}
1468+
14631469
// Map old func to new func
14641470
NewFuncWithIA.push_back(pNewFunc);
14651471
}

0 commit comments

Comments
 (0)