From 7ab2f49f8fb5c8360a2237ecd1aa57a6aa09d795 Mon Sep 17 00:00:00 2001 From: Pratik J Ashar Date: Fri, 25 Aug 2023 04:46:39 +0000 Subject: [PATCH] Mark indirect calls uniform When indirect calls are uniform, VISA can avoid applying some SW WAs (eg, fused call WA = 2). --- IGC/Compiler/CISACodeGen/CISABuilder.cpp | 3 ++- IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/IGC/Compiler/CISACodeGen/CISABuilder.cpp b/IGC/Compiler/CISACodeGen/CISABuilder.cpp index 04fc26e57d96..601eee858c8e 100644 --- a/IGC/Compiler/CISACodeGen/CISABuilder.cpp +++ b/IGC/Compiler/CISACodeGen/CISABuilder.cpp @@ -417,7 +417,8 @@ namespace IGC VISA_Exec_Size execSize = visaExecSize(m_program->m_dispatchSize); VISA_VectorOpnd* funcAddrOpnd = GetSourceOperandNoModifier(funcPtr); V(vKernel->AppendVISACFIndirectFuncCallInst( - predOpnd, emask, execSize, false, funcAddrOpnd, argSize, retSize)); + predOpnd, emask, execSize, funcPtr->IsUniform(), funcAddrOpnd, + argSize, retSize)); } void CEncoder::SubroutineRet(CVariable* flag, llvm::Function* F) diff --git a/IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp b/IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp index 2a62f3fab2ba..b6c5f7699423 100644 --- a/IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp +++ b/IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp @@ -867,7 +867,7 @@ class GenXKernelBuilder { unsigned char ReturnSize) { updateSIMDSize(ExecMask, ExecSize); CISA_CALL(Kernel->AppendVISACFIndirectFuncCallInst( - Pred, ExecMask, ExecSize, false, FuncAddr, ArgSize, ReturnSize)); + Pred, ExecMask, ExecSize, true, FuncAddr, ArgSize, ReturnSize)); } inline void appendVISACFRetInst(VISA_PredOpnd *Pred, VISA_EMask_Ctrl ExecMask,