Skip to content

Commit 28a4b3e

Browse files
dlei6gsys_zuul
authored andcommitted
Disable MTP when stack calls are present.
Change-Id: Ib7dd8da78dc8f443e01302b8baa3623da58b4823
1 parent c08431b commit 28a4b3e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3989,7 +3989,7 @@ namespace IGC
39893989
}
39903990

39913991
if ((context->type == ShaderType::OPENCL_SHADER || context->type == ShaderType::COMPUTE_SHADER) &&
3992-
VISAPlatform >= GENX_SKL && IGC_IS_FLAG_ENABLED(EnablePreemption) && !hasStackCall && !context->m_enableFunctionPointer)
3992+
VISAPlatform >= GENX_SKL && IGC_IS_FLAG_ENABLED(EnablePreemption) && !hasStackCall)
39933993
{
39943994
SaveOption(vISA_enablePreemption, true);
39953995
}

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,14 @@ bool EmitPass::runOnFunction(llvm::Function& F)
732732
}
733733
}
734734

735+
// Temp WA to disable MTP when stack calls are present
736+
// TODO: Remove when VISA is fixed to copy R0 to dedicated register, so R0 contents won't be corrupted by MTP
737+
if (m_currShader->GetShaderType() == ShaderType::OPENCL_SHADER && hasStackCall)
738+
{
739+
COpenCLKernel* kernel = static_cast<COpenCLKernel*>(m_currShader);
740+
kernel->SetDisableMidthreadPreemption();
741+
}
742+
735743
if (m_SimdMode == SIMDMode::SIMD16 &&
736744
this->m_ShaderMode == ShaderDispatchMode::NOT_APPLICABLE &&
737745
IsStage1BestPerf(m_pCtx->m_CgFlag, m_pCtx->m_StagingCtx))

0 commit comments

Comments
 (0)