[llvm] [AMDGPU] Optionally Use GCNRPTrackers during scheduling (PR #93090)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 00:38:03 PDT 2024
================
@@ -151,14 +157,42 @@ static bool canUsePressureDiffs(const SUnit &SU) {
static void getRegisterPressures(bool AtTop,
const RegPressureTracker &RPTracker, SUnit *SU,
std::vector<unsigned> &Pressure,
- std::vector<unsigned> &MaxPressure) {
+ std::vector<unsigned> &MaxPressure,
+ GCNDownwardRPTracker &DownwardTracker,
+ GCNUpwardRPTracker &UpwardTracker,
+ ScheduleDAGMI *DAG) {
// getDownwardPressure() and getUpwardPressure() make temporary changes to
// the tracker, so we need to pass those function a non-const copy.
RegPressureTracker &TempTracker = const_cast<RegPressureTracker &>(RPTracker);
- if (AtTop)
- TempTracker.getDownwardPressure(SU->getInstr(), Pressure, MaxPressure);
- else
- TempTracker.getUpwardPressure(SU->getInstr(), Pressure, MaxPressure);
+ if (!GCNTrackers) {
+ if (AtTop)
+ TempTracker.getDownwardPressure(SU->getInstr(), Pressure, MaxPressure);
+ else
+ TempTracker.getUpwardPressure(SU->getInstr(), Pressure, MaxPressure);
+ } else {
+ Pressure.resize(4, 0);
+ if (AtTop) {
+ GCNDownwardRPTracker TempTopTracker(DownwardTracker);
+ auto MI = SU->getInstr();
+ TempTopTracker.advance(MI, false, DAG->getLIS());
+
+ Pressure[AMDGPU::RegisterPressureSets::SReg_32] =
----------------
Pierre-vh wrote:
Just assign a `GCNRegPressure` variable and put the assignments at the end, outside the branches?
https://github.com/llvm/llvm-project/pull/93090
More information about the llvm-commits
mailing list