@@ -190,9 +190,10 @@ static void getRegisterPressures(
190190 TempUpwardTracker.recede (*MI);
191191 NewPressure = TempUpwardTracker.getPressure ();
192192 }
193- unsigned ArchVGPRThreshold =
194- DAG->MF .getSubtarget <GCNSubtarget>().getArchVGPRAllocationThreshold (
195- DAG->MF );
193+ unsigned ArchVGPRThreshold = DAG->MF .getSubtarget <GCNSubtarget>()
194+ .getRegisterInfo ()
195+ ->getMaxNumVectorRegs (DAG->MF )
196+ .first ;
196197 Pressure[AMDGPU::RegisterPressureSets::SReg_32] = NewPressure.getSGPRNum ();
197198 Pressure[AMDGPU::RegisterPressureSets::VGPR_32] =
198199 NewPressure.getArchVGPRNum (ArchVGPRThreshold);
@@ -343,9 +344,11 @@ void GCNSchedStrategy::pickNodeFromQueue(SchedBoundary &Zone,
343344 ? static_cast <GCNRPTracker *>(&UpwardTracker)
344345 : static_cast <GCNRPTracker *>(&DownwardTracker);
345346 SGPRPressure = T->getPressure ().getSGPRNum ();
346- VGPRPressure = T->getPressure ().getArchVGPRNum (
347- DAG->MF .getSubtarget <GCNSubtarget>().getArchVGPRAllocationThreshold (
348- DAG->MF ));
347+ VGPRPressure =
348+ T->getPressure ().getArchVGPRNum (DAG->MF .getSubtarget <GCNSubtarget>()
349+ .getRegisterInfo ()
350+ ->getMaxNumVectorRegs (DAG->MF )
351+ .first );
349352 }
350353 }
351354 ReadyQueue &Q = Zone.Available ;
@@ -1286,7 +1289,8 @@ void GCNSchedStage::checkScheduling() {
12861289 << print (PressureAfter, &ST, 0 , &MF));
12871290 LLVM_DEBUG (dbgs () << " Region: " << RegionIdx << " .\n " );
12881291
1289- unsigned ArchVGPRThreshold = ST.getArchVGPRAllocationThreshold (MF);
1292+ unsigned ArchVGPRThreshold =
1293+ ST.getRegisterInfo ()->getMaxNumVectorRegs (MF).first ;
12901294 if (PressureAfter.getSGPRNum () <= S.SGPRCriticalLimit &&
12911295 PressureAfter.getVGPRNum (ST.hasGFX90AInsts (), ArchVGPRThreshold) <=
12921296 S.VGPRCriticalLimit ) {
@@ -1478,7 +1482,8 @@ bool GCNSchedStage::shouldRevertScheduling(unsigned WavesAfter) {
14781482
14791483 // For dynamic VGPR mode, we don't want to waste any VGPR blocks.
14801484 if (DAG.MFI .isDynamicVGPREnabled ()) {
1481- unsigned ArchVGPRThreshold = ST.getArchVGPRAllocationThreshold (MF);
1485+ unsigned ArchVGPRThreshold =
1486+ ST.getRegisterInfo ()->getMaxNumVectorRegs (MF).first ;
14821487 unsigned BlocksBefore = AMDGPU::IsaInfo::getAllocatedNumVGPRBlocks (
14831488 &ST, DAG.MFI .getDynamicVGPRBlockSize (),
14841489 PressureBefore.getVGPRNum (false , ArchVGPRThreshold));
0 commit comments