Skip to content

Commit b805a71

Browse files
committed
Walk over all regions to compute AchievedOcc
1 parent fde49a3 commit b805a71

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
@@ -1485,15 +1485,17 @@ bool PreRARematStage::initGCNSchedStage() {
14851485
// occupancy in impacted regions.
14861486
REMAT_DEBUG(dbgs() << "==== REMAT RESULTS ====\n");
14871487
unsigned DynamicVGPRBlockSize = MFI.getDynamicVGPRBlockSize();
1488-
AchievedOcc = MFI.getMaxWavesPerEU();
14891488
for (unsigned I : RescheduleRegions.set_bits()) {
1490-
const GCNRegPressure &RP = RPTargets[I].getCurrentRP();
1491-
DAG.Pressure[I] = RP;
1492-
unsigned NewRegionOcc = RP.getOccupancy(ST, DynamicVGPRBlockSize);
1493-
AchievedOcc = std::min(AchievedOcc, NewRegionOcc);
1494-
REMAT_DEBUG(dbgs() << '[' << I << "] Achieved occupancy " << NewRegionOcc
1489+
DAG.Pressure[I] = RPTargets[I].getCurrentRP();
1490+
REMAT_DEBUG(dbgs() << '[' << I << "] Achieved occupancy "
1491+
<< DAG.Pressure[I].getOccupancy(ST, DynamicVGPRBlockSize)
14951492
<< " (" << RPTargets[I] << ")\n");
14961493
}
1494+
AchievedOcc = MFI.getMaxWavesPerEU();
1495+
for (const GCNRegPressure &RP : DAG.Pressure) {
1496+
AchievedOcc =
1497+
std::min(AchievedOcc, RP.getOccupancy(ST, DynamicVGPRBlockSize));
1498+
}
14971499

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

0 commit comments

Comments
 (0)