Skip to content

Commit 8b5752f

Browse files
jgu222igcbot
authored andcommitted
Need to update subroutine info
When a new BB is created and there are subroutines in the kernel, make sure to update subroutine table info(funcInfo) so that liveness info can be computed correctly.
1 parent 2ac676c commit 8b5752f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

visa/Optimizer.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15339,6 +15339,32 @@ void Optimizer::applyFusedCallWA()
1533915339
{
1534015340
builder.addFcallInfo(nCallI, orig_fcallinfo->getArgSize(), orig_fcallinfo->getRetSize());
1534115341
}
15342+
// Might need to update subroutine table
15343+
if (int numFuncs = (int)fg.sortedFuncTable.size())
15344+
{
15345+
for (int i = 0; i < numFuncs; ++i)
15346+
{
15347+
FuncInfo* pFInfo = fg.sortedFuncTable[i];
15348+
assert(pFInfo);
15349+
auto& tBBs = pFInfo->getBBList();
15350+
auto tBI = std::find(tBBs.begin(), tBBs.end(), nextBB);
15351+
if (tBI != tBBs.end())
15352+
{
15353+
// This is FuncInfo for the current func (including kernel entry func)
15354+
// Make sure new BBs are in the FuncInfo's BBList.
15355+
std::list<G4_BB*> toBeInserted;
15356+
toBeInserted.push_back(bigB0);
15357+
toBeInserted.push_back(bigB1);
15358+
toBeInserted.push_back(smallB0);
15359+
toBeInserted.push_back(smallB1);
15360+
tBBs.insert(tBI, toBeInserted.begin(), toBeInserted.end());
15361+
15362+
// inc call count as a call is duplicated
15363+
pFInfo->incrementCallCount();
15364+
break;
15365+
}
15366+
}
15367+
}
1534215368

1534315369
// Need to insert a join in nextBB
1534415370
G4_INST* tjoin = nextBB->getFirstInst();

0 commit comments

Comments
 (0)