Skip to content

Commit

Permalink
Reintroducing XE2 drop to SIMD16 functionality back
Browse files Browse the repository at this point in the history
Now we allow SIMD16 drop for spilling kernels on XE2.
  • Loading branch information
esukhov authored and igcbot committed Jan 31, 2025
1 parent 07a4be8 commit 3f87512
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
21 changes: 18 additions & 3 deletions IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3450,7 +3450,8 @@ namespace IGC

if (ctx->platform.getMinDispatchMode() == SIMDMode::SIMD16)
{
AddCodeGenPasses(*ctx, shaders, Passes, SIMDMode::SIMD32, false);
bool abortOnSpills = ctx->platform.isCoreXE2() && (ctx->getModuleMetaData()->csInfo.forcedSIMDSize != 32);
AddCodeGenPasses(*ctx, shaders, Passes, SIMDMode::SIMD32, abortOnSpills);
AddCodeGenPasses(*ctx, shaders, Passes, SIMDMode::SIMD16, false);

ctx->SetSIMDInfo(SIMD_SKIP_HW, SIMDMode::SIMD8, ShaderDispatchMode::NOT_APPLICABLE);
Expand Down Expand Up @@ -3755,9 +3756,23 @@ namespace IGC
return SIMDStatus::SIMD_FUNC_FAIL;
}

EP.m_canAbortOnSpill = false; // spill is always allowed since we don't do SIMD size lowering
// Next we check if there is a required sub group size specified
CodeGenContext* pCtx = GetContext();

CShader* simd16Program = m_parent->GetShader(SIMDMode::SIMD16);
CShader* simd32Program = m_parent->GetShader(SIMDMode::SIMD32);

bool compileFunctionVariants = pCtx->m_enableSimdVariantCompilation &&
(m_FGA && IGC::isIntelSymbolTableVoidProgram(m_FGA->getGroupHead(&F)));

if((simd16Program && simd16Program->ProgramOutput()->m_programSize > 0) ||
(simd32Program && simd32Program->ProgramOutput()->m_programSize > 0))
{
bool canCompileMultipleSIMD = compileFunctionVariants;
if (!(canCompileMultipleSIMD && (pCtx->getModuleMetaData()->csInfo.forcedSIMDSize == 0)))
return SIMDStatus::SIMD_FUNC_FAIL;
}

MetaDataUtils* pMdUtils = EP.getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils();
FunctionInfoMetaDataHandle funcInfoMD = pMdUtils->getFunctionsInfoItem(&F);
uint32_t simd_size = getReqdSubGroupSize(F, pMdUtils);
Expand Down Expand Up @@ -3860,7 +3875,7 @@ namespace IGC
return SIMDStatus::SIMD_PASS;
}

if (simdMode == SIMDMode::SIMD16 && !hasSubGroupForce && !forceLowestSIMDForStackCalls && !hasSubroutine)
if (simdMode == SIMDMode::SIMD16 && !pCtx->platform.isCoreXE2() && !hasSubGroupForce && !forceLowestSIMDForStackCalls && !hasSubroutine)
{
pCtx->SetSIMDInfo(SIMD_SKIP_PERF, simdMode, ShaderDispatchMode::NOT_APPLICABLE);
return SIMDStatus::SIMD_FUNC_FAIL;
Expand Down
4 changes: 4 additions & 0 deletions IGC/Compiler/CISACodeGen/Platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ bool isProductChildOf(PRODUCT_FAMILY product) const
return m_platformInfo.eProductFamily >= product;
}

bool isCoreXE2() const {
return ( m_platformInfo.eRenderCoreFamily == IGFX_XE2_HPG_CORE );
}

// This function checks if core is child of another core
bool isCoreChildOf(GFXCORE_FAMILY core) const
{
Expand Down

0 comments on commit 3f87512

Please sign in to comment.