Skip to content

Commit 6399a00

Browse files
esukhovigcbot
authored andcommitted
XE2 compiles to SIMD16 in case of spilling
XE2 compilation goes to SIMD16 route if we have spills during SIMD32 compilation. Test added & previous one that covered for kernels that exhaust PTSS changed.
1 parent 3a468ec commit 6399a00

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,8 @@ namespace IGC
34433443

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

34493450
ctx->SetSIMDInfo(SIMD_SKIP_HW, SIMDMode::SIMD8, ShaderDispatchMode::NOT_APPLICABLE);
@@ -3748,9 +3749,24 @@ namespace IGC
37483749
return SIMDStatus::SIMD_FUNC_FAIL;
37493750
}
37503751

3751-
EP.m_canAbortOnSpill = false; // spill is always allowed since we don't do SIMD size lowering
37523752
// Next we check if there is a required sub group size specified
37533753
CodeGenContext* pCtx = GetContext();
3754+
3755+
CShader* simd16Program = m_parent->GetShader(SIMDMode::SIMD16);
3756+
CShader* simd32Program = m_parent->GetShader(SIMDMode::SIMD32);
3757+
3758+
EP.m_canAbortOnSpill = false || pCtx->platform.isCoreXE2();
3759+
bool compileFunctionVariants = pCtx->m_enableSimdVariantCompilation &&
3760+
(m_FGA && IGC::isIntelSymbolTableVoidProgram(m_FGA->getGroupHead(&F)));
3761+
3762+
if((simd16Program && simd16Program->ProgramOutput()->m_programSize > 0) ||
3763+
(simd32Program && simd32Program->ProgramOutput()->m_programSize > 0))
3764+
{
3765+
bool canCompileMultipleSIMD = compileFunctionVariants;
3766+
if (!(canCompileMultipleSIMD && (pCtx->getModuleMetaData()->csInfo.forcedSIMDSize == 0)))
3767+
return SIMDStatus::SIMD_FUNC_FAIL;
3768+
}
3769+
37543770
MetaDataUtils* pMdUtils = EP.getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils();
37553771
FunctionInfoMetaDataHandle funcInfoMD = pMdUtils->getFunctionsInfoItem(&F);
37563772
uint32_t simd_size = getReqdSubGroupSize(F, pMdUtils);
@@ -3853,7 +3869,7 @@ namespace IGC
38533869
return SIMDStatus::SIMD_PASS;
38543870
}
38553871

3856-
if (simdMode == SIMDMode::SIMD16 && !hasSubGroupForce && !forceLowestSIMDForStackCalls && !hasSubroutine)
3872+
if (simdMode == SIMDMode::SIMD16 && !pCtx->platform.isCoreXE2() && !hasSubGroupForce && !forceLowestSIMDForStackCalls && !hasSubroutine)
38573873
{
38583874
pCtx->SetSIMDInfo(SIMD_SKIP_PERF, simdMode, ShaderDispatchMode::NOT_APPLICABLE);
38593875
return SIMDStatus::SIMD_FUNC_FAIL;

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ bool isProductChildOf(PRODUCT_FAMILY product) const
203203
return m_platformInfo.eProductFamily >= product;
204204
}
205205

206+
bool isCoreXE2() const {
207+
return ( m_platformInfo.eRenderCoreFamily == IGFX_XE2_HPG_CORE );
208+
}
209+
206210
// This function checks if core is child of another core
207211
bool isCoreChildOf(GFXCORE_FAMILY core) const
208212
{

0 commit comments

Comments
 (0)