Skip to content

Commit 74476cc

Browse files
dlei6gigcbot
authored andcommitted
Map subroutine implicit args to kernel's arg symbol, instead of copying (Attempt #2)
We don't need to copy the implicit arg since subroutines have access to the kernel's variables. Just update the symbol map such that implicit arg intrinsics are mapped to the kernel's formal arguments.
1 parent f456bac commit 74476cc

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20844,16 +20844,9 @@ void EmitPass::emitImplicitArgIntrinsic(llvm::GenIntrinsicInst* I)
2084420844
IGC_ASSERT_MESSAGE(arg, "Implicit argument not found!");
2084520845
if (arg)
2084620846
{
20847-
if (I->getType()->isVectorTy())
20848-
{
20849-
emitVectorCopy(GetSymbol(I), m_currShader->getOrCreateArgumentSymbol(arg, false),
20850-
int_cast<unsigned>(dyn_cast<IGCLLVM::FixedVectorType>(I->getType())->getNumElements()));
20851-
}
20852-
else
20853-
{
20854-
m_encoder->SetNoMask();
20855-
m_currShader->CopyVariable(GetSymbol(I), m_currShader->getOrCreateArgumentSymbol(arg, false));
20856-
}
20847+
// Direct symbol mapping to kernel argument, no need to copy for subroutines
20848+
CVariable* kernelArgV = m_currShader->getOrCreateArgumentSymbol(arg, false);
20849+
m_currShader->UpdateSymbolMap(I, kernelArgV);
2085720850
}
2085820851
}
2085920852
else

0 commit comments

Comments
 (0)