Skip to content

Commit c9ada7c

Browse files
bcheng0127igcbot
authored andcommitted
Fixed the bug when link stack call to subroutine call.
Fixed the bug when link stack call to subroutine call.
1 parent 393c54a commit c9ada7c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

visa/BuildCISAIRImpl.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,18 @@ void CISA_IR_Builder::LinkTimeOptimization(
758758
G4_Declare* topDcl = dst->getTopDcl();
759759
if (!topDcl) continue;
760760
G4_Declare* rootDcl = topDcl->getRootDeclare();
761+
762+
if (calleeBuilder->isPreDefArg(rootDcl))
763+
{
764+
G4_DstRegRegion *replacedArgDst = callerBuilder->createDst(
765+
replacedArgDcl->getRegVar(),
766+
dst->asDstRegRegion()->getRegOff(),
767+
dst->asDstRegRegion()->getSubRegOff(),
768+
dst->asDstRegRegion()->getHorzStride(),
769+
dst->getType());
770+
inst->setDest(replacedArgDst);
771+
}
772+
761773
if (calleeBuilder->isPreDefRet(rootDcl))
762774
{
763775
G4_DstRegRegion *replacedRetDst = callerBuilder->createDst(

0 commit comments

Comments
 (0)