Skip to content

Commit f41fddc

Browse files
committed
Walk over all regions to compute AchievedOcc
1 parent 68cd753 commit f41fddc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,15 +1306,17 @@ bool PreRARematStage::initGCNSchedStage() {
13061306
// occupancy in impacted regions.
13071307
REMAT_DEBUG(dbgs() << "==== REMAT RESULTS ====\n");
13081308
unsigned DynamicVGPRBlockSize = MFI.getDynamicVGPRBlockSize();
1309-
AchievedOcc = MFI.getMaxWavesPerEU();
13101309
for (unsigned I : RescheduleRegions.set_bits()) {
1311-
const GCNRegPressure &RP = RPTargets[I].getCurrentRP();
1312-
DAG.Pressure[I] = RP;
1313-
unsigned NewRegionOcc = RP.getOccupancy(ST, DynamicVGPRBlockSize);
1314-
AchievedOcc = std::min(AchievedOcc, NewRegionOcc);
1315-
REMAT_DEBUG(dbgs() << '[' << I << "] Achieved occupancy " << NewRegionOcc
1310+
DAG.Pressure[I] = RPTargets[I].getCurrentRP();
1311+
REMAT_DEBUG(dbgs() << '[' << I << "] Achieved occupancy "
1312+
<< DAG.Pressure[I].getOccupancy(ST, DynamicVGPRBlockSize)
13161313
<< " (" << RPTargets[I] << ")\n");
13171314
}
1315+
AchievedOcc = MFI.getMaxWavesPerEU();
1316+
for (const GCNRegPressure &RP : DAG.Pressure) {
1317+
AchievedOcc =
1318+
std::min(AchievedOcc, RP.getOccupancy(ST, DynamicVGPRBlockSize));
1319+
}
13181320

13191321
REMAT_DEBUG({
13201322
dbgs() << "Retrying function scheduling with new min. occupancy of "

0 commit comments

Comments
 (0)