diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index f4b5f7c02b715..d2eb7e72ac6b2 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -1326,48 +1326,7 @@ class HighRegisterPressureDetector { // Calculate the upper limit of each pressure set void computePressureSetLimit(const RegisterClassInfo &RCI) { for (unsigned PSet = 0; PSet < PSetNum; PSet++) - PressureSetLimit[PSet] = TRI->getRegPressureSetLimit(MF, PSet); - - // We assume fixed registers, such as stack pointer, are already in use. - // Therefore subtracting the weight of the fixed registers from the limit of - // each pressure set in advance. - SmallDenseSet FixedRegs; - for (const TargetRegisterClass *TRC : TRI->regclasses()) { - for (const MCPhysReg Reg : *TRC) - if (isFixedRegister(Reg)) - FixedRegs.insert(Reg); - } - - LLVM_DEBUG({ - for (auto Reg : FixedRegs) { - dbgs() << printReg(Reg, TRI, 0, &MRI) << ": ["; - for (MCRegUnit Unit : TRI->regunits(Reg)) { - const int *Sets = TRI->getRegUnitPressureSets(Unit); - for (; *Sets != -1; Sets++) { - dbgs() << TRI->getRegPressureSetName(*Sets) << ", "; - } - } - dbgs() << "]\n"; - } - }); - - for (auto Reg : FixedRegs) { - LLVM_DEBUG(dbgs() << "fixed register: " << printReg(Reg, TRI, 0, &MRI) - << "\n"); - for (MCRegUnit Unit : TRI->regunits(Reg)) { - auto PSetIter = MRI.getPressureSets(Unit); - unsigned Weight = PSetIter.getWeight(); - for (; PSetIter.isValid(); ++PSetIter) { - unsigned &Limit = PressureSetLimit[*PSetIter]; - assert( - Limit >= Weight && - "register pressure limit must be greater than or equal weight"); - Limit -= Weight; - LLVM_DEBUG(dbgs() << "PSet=" << *PSetIter << " Limit=" << Limit - << " (decreased by " << Weight << ")\n"); - } - } - } + PressureSetLimit[PSet] = RCI.getRegPressureSetLimit(PSet); } // There are two patterns of last-use.