Skip to content

Commit 8376eff

Browse files
dlei6gigcbot
authored andcommitted
Setting FunctionControl to force indirect call applies to all user functions,
instead of only to indirectly-callable functions defined by FE. This gives more control in testing indirect calls.
1 parent a75520c commit 8376eff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

IGC/AdaptorCommon/ProcessFuncAttributes.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,7 @@ bool ProcessFuncAttributes::runOnModule(Module& M)
551551
// Forcing subroutines/stack-call/indirect-call
552552
bool forceSubroutine = FCtrl == FLAG_FCALL_FORCE_SUBROUTINE;
553553
bool forceStackCall = FCtrl == FLAG_FCALL_FORCE_STACKCALL;
554-
bool forceIndirectCall = F->hasFnAttribute("IndirectlyCalled") &&
555-
(FCtrl == FLAG_FCALL_FORCE_INDIRECTCALL || F->hasFnAttribute("IFCALL_BUILTIN"));
554+
bool forceIndirectCall = (FCtrl == FLAG_FCALL_FORCE_INDIRECTCALL || F->hasFnAttribute("IFCALL_BUILTIN"));
556555

557556
if (forceSubroutine || forceStackCall || forceIndirectCall)
558557
{
@@ -561,6 +560,12 @@ bool ProcessFuncAttributes::runOnModule(Module& M)
561560
{
562561
F->addFnAttr("visaStackCall");
563562
}
563+
else if (forceIndirectCall)
564+
{
565+
pCtx->m_enableFunctionPointer = true;
566+
F->addFnAttr("IndirectlyCalled");
567+
F->addFnAttr("visaStackCall");
568+
}
564569
}
565570
}
566571
}

0 commit comments

Comments
 (0)