Skip to content

Commit a487518

Browse files
committed
Move the max RP calculation to end of stage
Change-Id: If9378e0c3682ef62768756bea8a0315fdd203594
1 parent 3677b70 commit a487518

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,15 @@ bool PreRARematStage::initGCNSchedStage() {
11301130
}
11311131

11321132
void GCNSchedStage::finalizeGCNSchedStage() {
1133+
unsigned MaxArchVGPR = 0;
1134+
for (auto P : DAG.Pressure) {
1135+
if (P.getArchVGPRNum() > MaxArchVGPR)
1136+
MaxArchVGPR = P.getArchVGPRNum();
1137+
}
1138+
1139+
MF.getInfo<SIMachineFunctionInfo>()->setMaxArchVGPRPressure(MaxArchVGPR);
1140+
1141+
11331142
DAG.finishBlock();
11341143
LLVM_DEBUG(dbgs() << "Ending scheduling stage: " << StageID << "\n");
11351144
}
@@ -1263,14 +1272,6 @@ void GCNSchedStage::finalizeGCNRegion() {
12631272
// reason that the original schedule is better.
12641273
checkScheduling();
12651274

1266-
unsigned MaxArchVGPR = 0;
1267-
for (auto P : DAG.Pressure) {
1268-
if (P.getArchVGPRNum() > MaxArchVGPR)
1269-
MaxArchVGPR = P.getArchVGPRNum();
1270-
}
1271-
1272-
MF.getInfo<SIMachineFunctionInfo>()->setMaxArchVGPRPressure(MaxArchVGPR);
1273-
12741275
if (DAG.RegionsWithIGLPInstrs[RegionIdx] &&
12751276
StageID != GCNSchedStageID::UnclusteredHighRPReschedule)
12761277
SavedMutations.swap(DAG.Mutations);

0 commit comments

Comments
 (0)