@@ -239,16 +239,6 @@ inline void AddAnalysisPasses(CodeGenContext &ctx, IGCPassManager& mpm)
239
239
// to avoid URBRead/URBWrite interference
240
240
AddURBWriteRelatedPass (ctx, mpm);
241
241
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
-
252
242
if (IGC_IS_FLAG_DISABLED (DisableMemOpt2) &&
253
243
(ctx.type == ShaderType::COMPUTE_SHADER || (ctx.m_DriverInfo .WAEnableMemOpt2ForOCL ())) &&
254
244
!isOptDisabled)
@@ -275,6 +265,7 @@ inline void AddAnalysisPasses(CodeGenContext &ctx, IGCPassManager& mpm)
275
265
// need this before WIAnalysis:
276
266
// insert phi to prevent changing of WIAnalysis result by later code-motion
277
267
mpm.add (llvm::createLCSSAPass ());
268
+
278
269
if ( !isOptDisabled )
279
270
{
280
271
// If you want to clean up the dead-code after push optimization
@@ -577,7 +568,17 @@ inline void AddLegalizationPasses(CodeGenContext &ctx, IGCPassManager& mpm)
577
568
// Scalarizer in codegen to handle the vector instructions
578
569
mpm.add (new ScalarizerCodeGen ());
579
570
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
581
582
// This require and preserves uniform analysis we should keep
582
583
// other passes using uniformness together to avoid re-running it several times
583
584
if (IGC_IS_FLAG_DISABLED (DisableConstantCoalescing))
0 commit comments