Skip to content

Commit 1a88d6e

Browse files
bcheng0127igcbot
authored andcommitted
Adjust pre-RA scheduling heuristic
Adjust pre-RA scheduling heuristic
1 parent b4641ae commit 1a88d6e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

visa/LocalScheduler/G4_Sched.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,8 +1672,8 @@ bool BB_Scheduler::scheduleBlockForLatency(unsigned &MaxPressure,
16721672
return false;
16731673

16741674
// UpperBoundGRF == 0 means we are scheduling for the fixed number of GRF
1675-
if (UpperBoundGRF == 0 &&
1676-
MaxPressure >= getLatencyHidingThreshold(kernel, nr))
1675+
unsigned LatencyPressureThreshold = getLatencyHidingThreshold(kernel, nr);
1676+
if (UpperBoundGRF == 0 && MaxPressure >= LatencyPressureThreshold)
16771677
return false;
16781678

16791679
// simple ROI check.
@@ -1685,8 +1685,15 @@ bool BB_Scheduler::scheduleBlockForLatency(unsigned &MaxPressure,
16851685
NumOfHighLatencyInsts++;
16861686
}
16871687
}
1688-
1689-
return NumOfHighLatencyInsts >= 2;
1688+
if (kernel.fg.builder->hasFiveALUPipes()) {
1689+
// For latest platform, do scheduling for kernels with low register
1690+
// pressure to improve ILP. Currently, half pressure threshold is used.
1691+
// Maybe tuned in future.
1692+
return (NumOfHighLatencyInsts >= 2) ||
1693+
(MaxPressure < (LatencyPressureThreshold / 2));
1694+
} else {
1695+
return (NumOfHighLatencyInsts >= 2);
1696+
}
16901697
};
16911698

16921699
unsigned NumGrfs =

0 commit comments

Comments
 (0)