@@ -239,16 +239,6 @@ inline void AddAnalysisPasses(CodeGenContext &ctx, IGCPassManager& mpm)
239239 // to avoid URBRead/URBWrite interference
240240 AddURBWriteRelatedPass (ctx, mpm);
241241
242- // moving the scheduling and sample clustering passes right before code-sinking.
243- // Need to merge the scheduling, code-sinking and clustering passes better to avoid redundancy and better optimization
244- if (IGC_IS_FLAG_DISABLED (DisablePreRAScheduler) &&
245- ctx.type == ShaderType::PIXEL_SHADER &&
246- ctx.m_retryManager .AllowPreRAScheduler () &&
247- !ctx.m_enableSubroutine )
248- {
249- mpm.add (createPreRASchedulerPass ());
250- }
251-
252242 if (IGC_IS_FLAG_DISABLED (DisableMemOpt2) &&
253243 (ctx.type == ShaderType::COMPUTE_SHADER || (ctx.m_DriverInfo .WAEnableMemOpt2ForOCL ())) &&
254244 !isOptDisabled)
@@ -275,6 +265,7 @@ inline void AddAnalysisPasses(CodeGenContext &ctx, IGCPassManager& mpm)
275265 // need this before WIAnalysis:
276266 // insert phi to prevent changing of WIAnalysis result by later code-motion
277267 mpm.add (llvm::createLCSSAPass ());
268+
278269 if ( !isOptDisabled )
279270 {
280271 // If you want to clean up the dead-code after push optimization
@@ -577,7 +568,17 @@ inline void AddLegalizationPasses(CodeGenContext &ctx, IGCPassManager& mpm)
577568 // Scalarizer in codegen to handle the vector instructions
578569 mpm.add (new ScalarizerCodeGen ());
579570
580- // coalesce scalar loads into loads of larger quantity.
571+ // moving the scheduling and sample clustering passes right before code-sinking.
572+ // Need to merge the scheduling, code-sinking and clustering passes better to avoid redundancy and better optimization
573+ if (IGC_IS_FLAG_DISABLED (DisablePreRAScheduler) &&
574+ ctx.type == ShaderType::PIXEL_SHADER &&
575+ ctx.m_retryManager .AllowPreRAScheduler () &&
576+ !ctx.m_enableSubroutine )
577+ {
578+ mpm.add (createPreRASchedulerPass ());
579+ }
580+
581+ // coalesce scalar loads into loads of larger quantity
581582 // This require and preserves uniform analysis we should keep
582583 // other passes using uniformness together to avoid re-running it several times
583584 if (IGC_IS_FLAG_DISABLED (DisableConstantCoalescing))
0 commit comments