@@ -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