Skip to content

Commit 21dd835

Browse files
jgu222igcbot
authored andcommitted
Improve jump codegen by setting uniform if jump's flag is workgroup/global uniform
under EU fusion.
1 parent 74b0983 commit 21dd835

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,10 @@ namespace IGC
460460
VISA_EMask_Ctrl emask = m_encoderState.m_noMask ? vISA_EMASK_M1_NM : vISA_EMASK_M1;
461461
VISA_Exec_Size execSize = visaExecSize(m_program->m_dispatchSize);
462462

463-
// As uniform maybe thread-uniform, it will not work for scalar jump
464-
// for two threads whose flags are different. Once we improve uniform
465-
// analysis to have global (uniform among all threads), not just local
466-
// uniform (within a thread), we can still generate scalar jump when flag
467-
// is a global uniform.
468-
//
469-
// For now, just disable uniform goto if EU fusion is on.
470-
if (flag == nullptr ||
463+
// If EU fusion is on, goto is uniform if flag is workgroup/global uniform;
464+
// otherwise, goto is uniform if flag is uniform (thread/workgroup/global).
465+
if (flag == nullptr || // unconditional jump is always uniform
466+
flag->IsWorkGroupOrGlobalUniform() ||
471467
(!m_program->m_Platform->hasFusedEU() && flag->IsUniform()))
472468
{
473469
execSize = EXEC_SIZE_1;

0 commit comments

Comments
 (0)