Skip to content

Commit e685340

Browse files
jgu222igcbot
authored andcommitted
Refactoring
When computing execution mask for the entire dispatch size, using a single cmp instead of 2 simd16 cmp for simd32 dispatch.
1 parent 0242d52 commit e685340

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10845,6 +10845,7 @@ CVariable* EmitPass::GetHalfExecutionMask()
1084510845
return eMask;
1084610846
}
1084710847

10848+
// Execution mask for the entire dispatch size, not for either first or second half instance.
1084810849
CVariable* EmitPass::GetExecutionMask(CVariable*& vecMaskVar)
1084910850
{
1085010851
bool isSecondHalf = m_encoder->IsSecondHalf();
@@ -10854,15 +10855,14 @@ CVariable* EmitPass::GetExecutionMask(CVariable*& vecMaskVar)
1085410855
CVariable* flag = m_currShader->ImmToVariable(0, ISA_TYPE_BOOL);
1085510856

1085610857
CVariable* dummyVar = m_currShader->GetNewVariable(1, ISA_TYPE_UW, EALIGN_WORD, true, CName::NONE);
10858+
if (m_currShader->m_dispatchSize > SIMDMode::SIMD16)
10859+
{
10860+
// Make sure to use simd32 always.
10861+
m_encoder->SetSimdSize(SIMDMode::SIMD32);
10862+
}
1085710863
m_encoder->Cmp(EPREDICATE_EQ, flag, dummyVar, dummyVar);
1085810864
m_encoder->Push();
1085910865

10860-
if (m_currShader->m_dispatchSize > SIMDMode::SIMD16 && m_currShader->m_SIMDSize != SIMDMode::SIMD32)
10861-
{
10862-
m_encoder->SetSecondHalf(true);
10863-
m_encoder->Cmp(EPREDICATE_EQ, flag, dummyVar, dummyVar);
10864-
m_encoder->Push();
10865-
}
1086610866
m_encoder->SetSecondHalf(isSecondHalf);
1086710867
m_encoder->SetSubSpanDestination(isSubSpanDst);
1086810868
vecMaskVar = flag;

0 commit comments

Comments
 (0)