Skip to content

Commit cfc6147

Browse files
committed
== -> >= for achieved occupancy check at the end of the stage
This prevents rollbacking rematerializations in case rescheduling improved occupancy even further than the target. Also fix format.
1 parent 6e0e80e commit cfc6147

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ void PreRARematStage::finalizeGCNSchedStage() {
21322132
// which case we do not want to rollback either (the rescheduling was already
21332133
// reverted in PreRARematStage::shouldRevertScheduling in such cases).
21342134
unsigned MaxOcc = std::max(AchievedOcc, DAG.MinOccupancy);
2135-
if (!IncreaseOccupancy || MaxOcc == TargetOcc)
2135+
if (!IncreaseOccupancy || MaxOcc >= TargetOcc)
21362136
return;
21372137

21382138
REMAT_DEBUG(dbgs() << "Rollbacking all rematerializations\n");

llvm/lib/Target/AMDGPU/GCNSubtarget.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,9 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
15581558

15591559
/// \returns max num VGPRs. This is the common utility function
15601560
/// called by MachineFunction and Function variants of getMaxNumVGPRs.
1561-
unsigned getBaseMaxNumVGPRs(const Function &F,
1562-
std::pair<unsigned, unsigned> NumVGPRBounds) const;
1561+
unsigned
1562+
getBaseMaxNumVGPRs(const Function &F,
1563+
std::pair<unsigned, unsigned> NumVGPRBounds) const;
15631564

15641565
/// \returns Maximum number of VGPRs that meets number of waves per execution
15651566
/// unit requirement for function \p F, or number of VGPRs explicitly

0 commit comments

Comments
 (0)