Skip to content

Commit 347b50f

Browse files
author
Tony Linthicum
committed
Format fixes from review comments.
1 parent b412e9c commit 347b50f

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

llvm/lib/Target/AMDGPU/GCNRegPressure.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ struct GCNRegPressure {
107107
if (!ST.hasGFX90AInsts())
108108
return 0;
109109

110-
auto MaxVectorRegs = ST.getMaxNumVectorRegs(MF.getFunction());
110+
std::pair<unsigned, unsigned> MaxVectorRegs =
111+
ST.getMaxNumVectorRegs(MF.getFunction());
111112
unsigned ArchVGPRThreshold = MaxVectorRegs.first;
112113
unsigned AGPRThreshold = MaxVectorRegs.second;
113114

@@ -121,7 +122,7 @@ struct GCNRegPressure {
121122
AGPRPressure > AGPRThreshold ? (AGPRPressure - AGPRThreshold) : 0;
122123

123124
unsigned CombinedThreshold = ST.getMaxNumVGPRs(MF);
124-
unsigned UnifiedPressure = getVGPRNum(true);
125+
unsigned UnifiedPressure = getVGPRNum(/*UnifiedVGPRFile=*/true);
125126
unsigned UnifiedSpill = UnifiedPressure > CombinedThreshold
126127
? (UnifiedPressure - CombinedThreshold)
127128
: 0;

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ bool RewriteScheduleStage::initGCNSchedStage() {
12991299
RegionsWithExcessArchVGPR.resize(DAG.Regions.size());
13001300
RegionsWithExcessArchVGPR.reset();
13011301
for (unsigned Region = 0; Region < DAG.Regions.size(); Region++) {
1302-
auto PressureBefore = DAG.Pressure[Region];
1302+
GCNRegPressure PressureBefore = DAG.Pressure[Region];
13031303
if (PressureBefore.getArchVGPRNum() > ST.getAddressableNumArchVGPRs())
13041304
RegionsWithExcessArchVGPR[Region] = true;
13051305
}
@@ -1985,42 +1985,42 @@ bool RewriteScheduleStage::initHeuristics(
19851985
}
19861986
}
19871987

1988-
MachineOperand &Dst = MI.getOperand(0);
1989-
SmallVector<MachineOperand *, 8> DstReachingUses;
1988+
MachineOperand &Dst = MI.getOperand(0);
1989+
SmallVector<MachineOperand *, 8> DstReachingUses;
19901990

1991-
findReachingUses(&MI, DAG.LIS, DstReachingUses);
1991+
findReachingUses(&MI, DAG.LIS, DstReachingUses);
19921992

1993-
for (MachineOperand *RUOp : DstReachingUses) {
1994-
if (TII->isMAI(*RUOp->getParent()))
1995-
continue;
1993+
for (MachineOperand *RUOp : DstReachingUses) {
1994+
if (TII->isMAI(*RUOp->getParent()))
1995+
continue;
19961996

1997-
// For any user of the result of the MFMA which is not an MFMA, we
1998-
// insert a copy. For a given register, we will only insert one copy
1999-
// per user block.
2000-
CopyForUse[RUOp->getParent()->getParent()].insert(RUOp->getReg());
1997+
// For any user of the result of the MFMA which is not an MFMA, we
1998+
// insert a copy. For a given register, we will only insert one copy
1999+
// per user block.
2000+
CopyForUse[RUOp->getParent()->getParent()].insert(RUOp->getReg());
20012001

2002-
SmallVector<SlotIndex, 8> DstUsesReachingDefs;
2003-
findReachingDefs(*RUOp, DAG.LIS, DstUsesReachingDefs);
2002+
SmallVector<SlotIndex, 8> DstUsesReachingDefs;
2003+
findReachingDefs(*RUOp, DAG.LIS, DstUsesReachingDefs);
20042004

2005-
for (auto RDIndex : DstUsesReachingDefs) {
2006-
MachineInstr *RD = DAG.LIS->getInstructionFromIndex(RDIndex);
2007-
if (TII->isMAI(*RD))
2008-
continue;
2005+
for (auto RDIndex : DstUsesReachingDefs) {
2006+
MachineInstr *RD = DAG.LIS->getInstructionFromIndex(RDIndex);
2007+
if (TII->isMAI(*RD))
2008+
continue;
20092009

2010-
// For any definition of the user of the MFMA which is not an MFMA,
2011-
// we insert a copy. We do this to transform all the reaching defs
2012-
// of this use to AGPR. By doing this, we can insert a copy from
2013-
// AGPR to VGPR at the user rather than after the MFMA.
2014-
CopyForDef.insert(RD);
2015-
}
2010+
// For any definition of the user of the MFMA which is not an MFMA,
2011+
// we insert a copy. We do this to transform all the reaching defs
2012+
// of this use to AGPR. By doing this, we can insert a copy from
2013+
// AGPR to VGPR at the user rather than after the MFMA.
2014+
CopyForDef.insert(RD);
20162015
}
2016+
}
20172017

2018-
// Do the rewrite to allow for updated RP calculation.
2019-
const TargetRegisterClass *VGPRRC = DAG.MRI.getRegClass(Dst.getReg());
2020-
const TargetRegisterClass *AGPRRC = SRI->getEquivalentAGPRClass(VGPRRC);
2021-
DAG.MRI.setRegClass(Dst.getReg(), AGPRRC);
2022-
if (Src2->isReg())
2023-
DAG.MRI.setRegClass(Src2->getReg(), AGPRRC);
2018+
// Do the rewrite to allow for updated RP calculation.
2019+
const TargetRegisterClass *VGPRRC = DAG.MRI.getRegClass(Dst.getReg());
2020+
const TargetRegisterClass *AGPRRC = SRI->getEquivalentAGPRClass(VGPRRC);
2021+
DAG.MRI.setRegClass(Dst.getReg(), AGPRRC);
2022+
if (Src2->isReg())
2023+
DAG.MRI.setRegClass(Src2->getReg(), AGPRRC);
20242024
}
20252025
}
20262026

0 commit comments

Comments
 (0)