@@ -1326,48 +1326,7 @@ class HighRegisterPressureDetector {
1326
1326
// Calculate the upper limit of each pressure set
1327
1327
void computePressureSetLimit (const RegisterClassInfo &RCI) {
1328
1328
for (unsigned PSet = 0 ; PSet < PSetNum; PSet++)
1329
- PressureSetLimit[PSet] = TRI->getRegPressureSetLimit (MF, PSet);
1330
-
1331
- // We assume fixed registers, such as stack pointer, are already in use.
1332
- // Therefore subtracting the weight of the fixed registers from the limit of
1333
- // each pressure set in advance.
1334
- SmallDenseSet<Register, 8 > FixedRegs;
1335
- for (const TargetRegisterClass *TRC : TRI->regclasses ()) {
1336
- for (const MCPhysReg Reg : *TRC)
1337
- if (isFixedRegister (Reg))
1338
- FixedRegs.insert (Reg);
1339
- }
1340
-
1341
- LLVM_DEBUG ({
1342
- for (auto Reg : FixedRegs) {
1343
- dbgs () << printReg (Reg, TRI, 0 , &MRI) << " : [" ;
1344
- for (MCRegUnit Unit : TRI->regunits (Reg)) {
1345
- const int *Sets = TRI->getRegUnitPressureSets (Unit);
1346
- for (; *Sets != -1 ; Sets++) {
1347
- dbgs () << TRI->getRegPressureSetName (*Sets) << " , " ;
1348
- }
1349
- }
1350
- dbgs () << " ]\n " ;
1351
- }
1352
- });
1353
-
1354
- for (auto Reg : FixedRegs) {
1355
- LLVM_DEBUG (dbgs () << " fixed register: " << printReg (Reg, TRI, 0 , &MRI)
1356
- << " \n " );
1357
- for (MCRegUnit Unit : TRI->regunits (Reg)) {
1358
- auto PSetIter = MRI.getPressureSets (Unit);
1359
- unsigned Weight = PSetIter.getWeight ();
1360
- for (; PSetIter.isValid (); ++PSetIter) {
1361
- unsigned &Limit = PressureSetLimit[*PSetIter];
1362
- assert (
1363
- Limit >= Weight &&
1364
- " register pressure limit must be greater than or equal weight" );
1365
- Limit -= Weight;
1366
- LLVM_DEBUG (dbgs () << " PSet=" << *PSetIter << " Limit=" << Limit
1367
- << " (decreased by " << Weight << " )\n " );
1368
- }
1369
- }
1370
- }
1329
+ PressureSetLimit[PSet] = RCI.getRegPressureSetLimit (PSet);
1371
1330
}
1372
1331
1373
1332
// There are two patterns of last-use.
0 commit comments