Skip to content

Commit 98a7e5d

Browse files
houjenkosys_zuul
authored andcommitted
[IGC Feature][IGC] Staged compilation TGL support
Change-Id: I3247a7970da3f7df3a5215c8a9aad58614b9146b
1 parent d047dd1 commit 98a7e5d

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

IGC/AdaptorCommon/API/igc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ typedef enum {
127127
!(!IsRetry(stats) && !DoSimd16(stats))) || \
128128
((IsStage1BestPerf(flag, prev_ctx_ptr)) && \
129129
( IGC_IS_FLAG_ENABLED(ExtraRetrySIMD16) && !HasSimdSpill(8, stats)) || \
130-
(!IGC_IS_FLAG_ENABLED(ExtraRetrySIMD16) && !HasSimd(8, stats)))) \
130+
(!IGC_IS_FLAG_ENABLED(ExtraRetrySIMD16) && (!HasSimd(8, stats) || DoSimd32(stats))))) \
131131
)
132132

133133
// Return true when simd MODE has been generated previously

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ bool EmitPass::runOnFunction(llvm::Function& F)
825825
}
826826

827827
if (m_SimdMode == SIMDMode::SIMD16 &&
828+
this->m_ShaderMode == ShaderDispatchMode::NOT_APPLICABLE &&
828829
IsStage1BestPerf(m_pCtx->m_CgFlag, m_pCtx->m_StagingCtx))
829830
{
830831
m_pCtx->m_doSimd32Stage2 = m_currShader->CompileSIMDSize(SIMDMode::SIMD32, *this, F);

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,26 @@ namespace IGC
795795
bool earlyExit =
796796
ctx->getCompilerOption().pixelShaderDoNotAbortOnSpill ? false : true;
797797

798+
// for versioned loop, in general SIMD16 with spill has better perf
799+
bool earlyExit16 = psInfo.hasVersionedLoop ? false : earlyExit;
800+
bool enableSimd32 = false;
801+
802+
if (psInfo.ForceEnableSimd32) // UMD forced compilation of simd32.
803+
{
804+
enableSimd32 = true;
805+
}
806+
// heuristic based on performance measures.
807+
else if (SimdEarlyCheck(ctx))
808+
{
809+
enableSimd32 = true;
810+
}
811+
798812
if (IsStage1BestPerf(ctx->m_CgFlag, ctx->m_StagingCtx))
799813
{
800814
// don't retry SIMD16 for ForcePSBestSIMD
801-
if( SimdEarlyCheck( ctx ) && ( !ctx->m_retryManager.IsLastTry() ) )
815+
if (enableSimd32 || IGC_GET_FLAG_VALUE(SkipTREarlyExitCheck))
802816
{
803-
AddCodeGenPasses(*ctx, shaders, PassMgr, SIMDMode::SIMD16, true, ShaderDispatchMode::NOT_APPLICABLE, pSignature);
817+
AddCodeGenPasses(*ctx, shaders, PassMgr, SIMDMode::SIMD16, earlyExit16, ShaderDispatchMode::NOT_APPLICABLE, pSignature);
804818
}
805819
AddCodeGenPasses(*ctx, shaders, PassMgr, SIMDMode::SIMD8, !ctx->m_retryManager.IsLastTry(), ShaderDispatchMode::NOT_APPLICABLE, pSignature);
806820
useRegKeySimd = true;
@@ -838,20 +852,6 @@ namespace IGC
838852

839853
if (!useRegKeySimd)
840854
{
841-
bool enableSimd32 = false;
842-
843-
if (psInfo.ForceEnableSimd32) // UMD forced compilation of simd32.
844-
{
845-
enableSimd32 = true;
846-
}
847-
// heuristic based on performance measures.
848-
else if (SimdEarlyCheck(ctx))
849-
{
850-
enableSimd32 = true;
851-
}
852-
853-
// for versioned loop, in general SIMD16 with spill has better perf
854-
bool earlyExit16 = psInfo.hasVersionedLoop ? false : earlyExit;
855855
AddCodeGenPasses(*ctx, shaders, PassMgr, SIMDMode::SIMD8, !ctx->m_retryManager.IsLastTry(), ShaderDispatchMode::NOT_APPLICABLE, pSignature);
856856

857857
if (enableSimd32 || IGC_GET_FLAG_VALUE(SkipTREarlyExitCheck))

0 commit comments

Comments
 (0)