Skip to content

Commit

Permalink
CS SIMD mode flag priority
Browse files Browse the repository at this point in the history
Flags like ForceCSSIMD32 should have priority over all other methods
of forcing simd modes in compute shaders.
  • Loading branch information
davidjwoo authored and igcbot committed Sep 21, 2023
1 parent e41de38 commit 35c81de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
16 changes: 10 additions & 6 deletions IGC/AdaptorCommon/DivergentBarrierPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,18 +493,22 @@ bool DivergentBarrierPass::processShader(Function* F)
// so no need to add the divergent barrier WA.
bool skipTGbarriers = false;
unsigned forcedSimdSize = 0;
if (IGC_IS_FLAG_ENABLED(ForceCSSIMD32) ||
m_CGCtx->getModuleMetaData()->csInfo.waveSize == 32 ||
m_CGCtx->getModuleMetaData()->csInfo.forcedSIMDSize == 32)
if (IGC_IS_FLAG_ENABLED(ForceCSSIMD32))
{
forcedSimdSize = 32;
}
else if (IGC_IS_FLAG_ENABLED(ForceCSSIMD16) ||
m_CGCtx->getModuleMetaData()->csInfo.waveSize == 16 ||
m_CGCtx->getModuleMetaData()->csInfo.forcedSIMDSize == 16)
else if (IGC_IS_FLAG_ENABLED(ForceCSSIMD16))
{
forcedSimdSize = 16;
}
else if (m_CGCtx->getModuleMetaData()->csInfo.forcedSIMDSize >= 16)
{
forcedSimdSize = m_CGCtx->getModuleMetaData()->csInfo.forcedSIMDSize;
}
else if (m_CGCtx->getModuleMetaData()->csInfo.waveSize >= 16)
{
forcedSimdSize = m_CGCtx->getModuleMetaData()->csInfo.waveSize;
}
ConstantInt* groupSize = dyn_cast<ConstantInt>(getGroupSize(*F));
if (groupSize &&
forcedSimdSize >= groupSize->getValue().getZExtValue())
Expand Down
14 changes: 10 additions & 4 deletions IGC/AdaptorCommon/RayTracing/TraceRayInlineLoweringPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,10 +967,16 @@ bool RTGlobalsPointerLoweringPass::needsSplitting(const CodeGenContext* Ctx)

auto& csInfo = Ctx->getModuleMetaData()->csInfo;

if (IGC_IS_FLAG_ENABLED(ForceCSSIMD32) ||
IGC_GET_FLAG_VALUE(ForceCSSimdSize4RQ) == 32 ||
csInfo.waveSize == 32 ||
csInfo.forcedSIMDSize == 32)
if (IGC_IS_FLAG_ENABLED(ForceCSSIMD32) ||
IGC_GET_FLAG_VALUE(ForceCSSimdSize4RQ) == 32)
return true;
if (IGC_IS_FLAG_ENABLED(ForceCSSIMD16))
return false;
if (csInfo.forcedSIMDSize == 32)
return true;
if (csInfo.forcedSIMDSize == 16)
return false;
if (csInfo.waveSize == 32)
return true;

return false;
Expand Down

0 comments on commit 35c81de

Please sign in to comment.