Skip to content

Commit 685eda6

Browse files
authored
Print spillweight of RefPosition (#54933)
1 parent 36e0432 commit 685eda6

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/coreclr/jit/lsra.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,7 +2467,7 @@ void LinearScan::dumpVarRefPositions(const char* title)
24672467
printf(" (Interval %d)\n", interval->intervalIndex);
24682468
for (RefPosition* ref = interval->firstRefPosition; ref != nullptr; ref = ref->nextRefPosition)
24692469
{
2470-
ref->dump();
2470+
ref->dump(this);
24712471
}
24722472
}
24732473
else
@@ -4346,7 +4346,7 @@ void LinearScan::dumpRefPositions(const char* str)
43464346
printf("------------\n");
43474347
for (RefPosition& refPos : refPositions)
43484348
{
4349-
refPos.dump();
4349+
refPos.dump(this);
43504350
}
43514351
}
43524352
#endif // DEBUG
@@ -8895,7 +8895,7 @@ const char* LinearScan::getScoreName(RegisterScore score)
88958895
}
88968896
}
88978897

8898-
void RefPosition::dump()
8898+
void RefPosition::dump(LinearScan* linearScan)
88998899
{
89008900
printf("<RefPosition #%-3u @%-3u", rpNum, nodeLocation);
89018901

@@ -8969,6 +8969,8 @@ void RefPosition::dump()
89698969
{
89708970
printf(" regOptional");
89718971
}
8972+
8973+
printf(" wt=%.2f", linearScan->getWeight(this));
89728974
printf(">\n");
89738975
}
89748976

src/coreclr/jit/lsra.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
// Licensed to the .NET Foundation under one or more agreements.
23
// The .NET Foundation licenses this file to you under the MIT license.
34
/*****************************************************************************/
@@ -2444,7 +2445,7 @@ class RefPosition
24442445
return *this;
24452446
}
24462447

2447-
void dump();
2448+
void dump(LinearScan* linearScan);
24482449
#endif // DEBUG
24492450
};
24502451

src/coreclr/jit/lsrabuild.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ RefPosition* LinearScan::newRefPosition(
525525
(regRecord->lastRefPosition->refType != theRefType));
526526
associateRefPosWithInterval(newRP);
527527

528-
DBEXEC(VERBOSE, newRP->dump());
528+
DBEXEC(VERBOSE, newRP->dump(this));
529529
return newRP;
530530
}
531531

@@ -620,7 +620,7 @@ RefPosition* LinearScan::newRefPosition(Interval* theInterval,
620620

621621
associateRefPosWithInterval(newRP);
622622

623-
DBEXEC(VERBOSE, newRP->dump());
623+
DBEXEC(VERBOSE, newRP->dump(this));
624624
return newRP;
625625
}
626626

@@ -2624,7 +2624,7 @@ void LinearScan::validateIntervals()
26242624
printf("-----------------\n");
26252625
for (RefPosition* ref = interval->firstRefPosition; ref != nullptr; ref = ref->nextRefPosition)
26262626
{
2627-
ref->dump();
2627+
ref->dump(this);
26282628
RefType refType = ref->refType;
26292629
if (!defined && RefTypeIsUse(refType))
26302630
{

0 commit comments

Comments
 (0)