Skip to content

Commit 4b90dab

Browse files
jgu222igcbot
authored andcommitted
Improve jump codegen by setting uniform if jump's flag is workgroup/global uniform
under EU fusion. It is off for now. And it can be turned on by setting key EnableWorkGroupUniformGoto to 1.
1 parent 7f5caaf commit 4b90dab

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,17 @@ namespace IGC
444444
VISA_EMask_Ctrl emask = m_encoderState.m_noMask ? vISA_EMASK_M1_NM : vISA_EMASK_M1;
445445
VISA_Exec_Size execSize = visaExecSize(m_program->m_dispatchSize);
446446

447-
// As uniform maybe thread-uniform, it will not work for scalar jump
448-
// for two threads whose flags are different. Once we improve uniform
449-
// analysis to have global (uniform among all threads), not just local
450-
// uniform (within a thread), we can still generate scalar jump when flag
451-
// is a global uniform.
452-
//
453-
// For now, just disable uniform goto if EU fusion is on.
447+
// visa and igc agreement.
448+
// goto (1) is used to tell visa the goto is uniform.
449+
// Goto(1) is generated if
450+
// 1. jump is unconditional, or
451+
// 2. jump is uniform (thread uniform or above) and no EU fusion, or
452+
// 3. jump is either workgroup or global uniform under EU fusion
453+
// (it is temporarily under key control for ease of debugging)
454454
if (flag == nullptr ||
455-
(!m_program->m_Platform->hasFusedEU() && flag->IsUniform()))
455+
(!m_program->m_Platform->hasFusedEU() && flag->IsUniform()) ||
456+
(IGC_IS_FLAG_ENABLED(EnableWorkGroupUniformGoto) &&
457+
m_program->m_Platform->hasFusedEU() && flag->IsWorkGroupOrGlobalUniform()))
456458
{
457459
execSize = EXEC_SIZE_1;
458460
}
@@ -4272,7 +4274,7 @@ namespace IGC
42724274
{
42734275
SaveOption( vISA_LocalScheduling, false );
42744276
// temporarily enabling preRA_schedule due to the ACOdyssey regression in IGC-4149. May be re-disenabled later
4275-
// SaveOption( vISA_preRA_Schedule, false );
4277+
// SaveOption( vISA_preRA_Schedule, false );
42764278
SaveOption( vISA_SpillSpaceCompression, false );
42774279
SaveOption( vISA_LVN, false );
42784280
SaveOption( vISA_QuickTokenAllocation, true );

IGC/common/igc_flags.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ DECLARE_IGC_REGKEY(bool, DisablePayloadCoalescing_RT, false, "Setting this to
8989
DECLARE_IGC_REGKEY(bool, DisablePayloadCoalescing_Sample, false, "Setting this to 1/true adds a compiler switch to disable payload coalescing optimization for Samplers only", false)
9090
DECLARE_IGC_REGKEY(bool, DisablePayloadCoalescing_URB, false, "Setting this to 1/true adds a compiler switch to disable payload coalescing optimization for URB writes only", false)
9191
DECLARE_IGC_REGKEY(bool, DisableUniformAnalysis, false, "Setting this to 1/true adds a compiler switch to disable uniform_analysis", false)
92+
DECLARE_IGC_REGKEY(bool, EnableWorkGroupUniformGoto, false, "Setting to 1 enables generating uniform goto for work group uniform [eu fusion only]", false)
9293
DECLARE_IGC_REGKEY(DWORD, DisablePushConstant, 0, "Bit mask to disable push constant per shader stages. bit0 = All, Bit 1 = VS, Bit 2 = HS, Bit 3 = DS, Bit 4 = GS, Bit 5 = PS", false)
9394
DECLARE_IGC_REGKEY(DWORD, DisableAttributePush, 0, "Bit mask to disable push Attribute per shader stages. bit0 = All, Bit 1 = VS, Bit 2 = HS, Bit 3 = DS, Bit 4 = GS", false)
9495
DECLARE_IGC_REGKEY(bool, DisableSimplePushWithDynamicUniformBuffers, false,"Disable Simple Push Constants Optimization for dynamic uniform buffers.", false)

0 commit comments

Comments
 (0)