Skip to content

Commit 38e255d

Browse files
committed
Rebase for getMaxNumVectorRegs move
Change-Id: I17c9239229b94c42c35b5683d77f8dfe3f70bafc
1 parent 5a0696d commit 38e255d

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

llvm/lib/Target/AMDGPU/GCNRegPressure.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool GCNRegPressure::less(const MachineFunction &MF, const GCNRegPressure &O,
100100
unsigned MaxOccupancy) const {
101101
const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
102102
unsigned ArchVGPRThreshold =
103-
ST.getRegisterInfo()->getMaxNumVectorRegs(MF).first;
103+
ST.getMaxNumVectorRegs(MF.getFunction()).first;
104104
unsigned DynamicVGPRBlockSize =
105105
MF.getInfo<SIMachineFunctionInfo>()->getDynamicVGPRBlockSize();
106106

@@ -252,7 +252,7 @@ Printable llvm::print(const GCNRegPressure &RP, const GCNSubtarget *ST,
252252
unsigned DynamicVGPRBlockSize,
253253
const MachineFunction *MF) {
254254
unsigned ArchVGPRThreshold =
255-
ST->getRegisterInfo()->getMaxNumVectorRegs(*MF).first;
255+
ST->getMaxNumVectorRegs(MF->getFunction()).first;
256256
return Printable(
257257
[&RP, ST, DynamicVGPRBlockSize, ArchVGPRThreshold, MF](raw_ostream &OS) {
258258
OS << "VGPRs: " << RP.getArchVGPRNum(ArchVGPRThreshold) << ' '
@@ -906,8 +906,7 @@ bool GCNRegPressurePrinter::runOnMachineFunction(MachineFunction &MF) {
906906
return Printable([&RP, &MF](raw_ostream &OS) {
907907
OS << format(PFX " %-5d", RP.getSGPRNum())
908908
<< format(" %-5d", RP.getVGPRNum(false, MF.getSubtarget<GCNSubtarget>()
909-
.getRegisterInfo()
910-
->getMaxNumVectorRegs(MF)
909+
.getMaxNumVectorRegs(MF.getFunction())
911910
.first));
912911
});
913912
};

llvm/lib/Target/AMDGPU/GCNRegPressure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct GCNRegPressure {
132132
ST.getOccupancyWithNumSGPRs(getSGPRNum()),
133133
ST.getOccupancyWithNumVGPRs(
134134
getVGPRNum(ST.hasGFX90AInsts(),
135-
ST.getRegisterInfo()->getMaxNumVectorRegs(MF).first),
135+
ST.getMaxNumVectorRegs(MF.getFunction()).first),
136136
DynamicVGPRBlockSize));
137137
}
138138

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ static void getRegisterPressures(
191191
NewPressure = TempUpwardTracker.getPressure();
192192
}
193193
unsigned ArchVGPRThreshold = DAG->MF.getSubtarget<GCNSubtarget>()
194-
.getRegisterInfo()
195-
->getMaxNumVectorRegs(DAG->MF)
194+
.getMaxNumVectorRegs(DAG->MF.getFunction())
196195
.first;
197196
Pressure[AMDGPU::RegisterPressureSets::SReg_32] = NewPressure.getSGPRNum();
198197
Pressure[AMDGPU::RegisterPressureSets::VGPR_32] =
@@ -346,8 +345,7 @@ void GCNSchedStrategy::pickNodeFromQueue(SchedBoundary &Zone,
346345
SGPRPressure = T->getPressure().getSGPRNum();
347346
VGPRPressure =
348347
T->getPressure().getArchVGPRNum(DAG->MF.getSubtarget<GCNSubtarget>()
349-
.getRegisterInfo()
350-
->getMaxNumVectorRegs(DAG->MF)
348+
.getMaxNumVectorRegs(DAG->MF.getFunction())
351349
.first);
352350
}
353351
}
@@ -1290,7 +1288,7 @@ void GCNSchedStage::checkScheduling() {
12901288
LLVM_DEBUG(dbgs() << "Region: " << RegionIdx << ".\n");
12911289

12921290
unsigned ArchVGPRThreshold =
1293-
ST.getRegisterInfo()->getMaxNumVectorRegs(MF).first;
1291+
ST.getMaxNumVectorRegs(MF.getFunction()).first;
12941292
if (PressureAfter.getSGPRNum() <= S.SGPRCriticalLimit &&
12951293
PressureAfter.getVGPRNum(ST.hasGFX90AInsts(), ArchVGPRThreshold) <=
12961294
S.VGPRCriticalLimit) {
@@ -1483,7 +1481,7 @@ bool GCNSchedStage::shouldRevertScheduling(unsigned WavesAfter) {
14831481
// For dynamic VGPR mode, we don't want to waste any VGPR blocks.
14841482
if (DAG.MFI.isDynamicVGPREnabled()) {
14851483
unsigned ArchVGPRThreshold =
1486-
ST.getRegisterInfo()->getMaxNumVectorRegs(MF).first;
1484+
ST.getMaxNumVectorRegs(MF.getFunction()).first;
14871485
unsigned BlocksBefore = AMDGPU::IsaInfo::getAllocatedNumVGPRBlocks(
14881486
&ST, DAG.MFI.getDynamicVGPRBlockSize(),
14891487
PressureBefore.getVGPRNum(false, ArchVGPRThreshold));

llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ bool SIFormMemoryClausesImpl::checkPressure(const MachineInstr &MI,
211211
if (Occupancy >= MFI->getMinAllowedOccupancy() &&
212212
MaxPressure.getVGPRNum(
213213
ST->hasGFX90AInsts(),
214-
ST->getRegisterInfo()->getMaxNumVectorRegs(*MI.getMF()).first) <=
214+
ST->getMaxNumVectorRegs(MI.getMF()->getFunction()).first) <=
215215
MaxVGPRs / 2 &&
216216
MaxPressure.getSGPRNum() <= MaxSGPRs / 2) {
217217
LastRecordedOccupancy = Occupancy;

0 commit comments

Comments
 (0)