Skip to content

Commit 80cec3f

Browse files
itsimbaligcbot
authored andcommitted
disable LICM when unmasked mode is set
Loop invariant code motion is known to break unmasked functions, as it may move code in and out of these unmasked functions. Best one should just disable LICM whenever unmasked mode is used. LICM is disabled after unmasked functions are inlined.
1 parent 2085092 commit 80cec3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ static void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSi
365365
IGC_SET_FLAG_VALUE(FastCompileRA, 1);
366366
IGC_SET_FLAG_VALUE(HybridRAWithSpill, 1);
367367
}
368+
// Disable loop invariant motion after Unmasked functions are inlined
369+
// at optimization phase
370+
if (IGC_IS_FLAG_ENABLED(EnableUnmaskedFunctions) &&
371+
IGC_IS_FLAG_DISABLED(LateInlineUnmaskedFunc)) {
372+
IGC_SET_FLAG_VALUE(allowLICM, false);
373+
}
368374

369375
if (IGC_IS_FLAG_ENABLED(ForceAllPrivateMemoryToSLM) ||
370376
IGC_IS_FLAG_ENABLED(ForcePrivateMemoryToSLMOnBuffers))

0 commit comments

Comments
 (0)