Skip to content

Commit

Permalink
Fix LSRA dump of GC Kills (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarolEidt authored Jan 7, 2020
1 parent 66cb5f9 commit d5e2081
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions src/coreclr/src/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4443,6 +4443,7 @@ void LinearScan::spillGCRefs(RefPosition* killRefPosition)
// For each physical register that can hold a GC type,
// if it is occupied by an interval of a GC type, spill that interval.
regMaskTP candidateRegs = killRefPosition->registerAssignment;
INDEBUG(bool killedRegs = false);
while (candidateRegs != RBM_NONE)
{
regMaskTP nextRegBit = genFindLowestBit(candidateRegs);
Expand Down Expand Up @@ -4470,11 +4471,12 @@ void LinearScan::spillGCRefs(RefPosition* killRefPosition)
}
if (needsKill)
{
INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_KILL_GC_REF, nullptr, nextReg, nullptr));
INDEBUG(killedRegs = true);
unassignPhysReg(regRecord, assignedInterval->recentRefPosition);
}
}
INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_DONE_KILL_GC_REFS, nullptr, REG_NA, nullptr));
INDEBUG(dumpLsraAllocationEvent(killedRegs ? LSRA_EVENT_DONE_KILL_GC_REFS : LSRA_EVENT_NO_GC_KILLS, nullptr, REG_NA,
nullptr));
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -9716,9 +9718,14 @@ void LinearScan::dumpLsraAllocationEvent(LsraDumpEvent event,
dumpRegRecords();
break;

// Done with GC Kills
case LSRA_EVENT_DONE_KILL_GC_REFS:
printf(indentFormat, " DoneKillGC ");
dumpRefPositionShort(activeRefPosition, currentBlock);
printf("Done ");
break;

case LSRA_EVENT_NO_GC_KILLS:
dumpRefPositionShort(activeRefPosition, currentBlock);
printf("None ");
break;

// Block boundaries
Expand Down Expand Up @@ -9831,7 +9838,9 @@ void LinearScan::dumpLsraAllocationEvent(LsraDumpEvent event,
break;

default:
unreached();
printf("????? %-4s ", getRegName(reg));
dumpRegRecords();
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/lsra.h
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ class LinearScan : public LinearScanInterface

// Spilling
LSRA_EVENT_SPILL, LSRA_EVENT_SPILL_EXTENDED_LIFETIME, LSRA_EVENT_RESTORE_PREVIOUS_INTERVAL,
LSRA_EVENT_RESTORE_PREVIOUS_INTERVAL_AFTER_SPILL, LSRA_EVENT_KILL_GC_REF, LSRA_EVENT_DONE_KILL_GC_REFS,
LSRA_EVENT_RESTORE_PREVIOUS_INTERVAL_AFTER_SPILL, LSRA_EVENT_DONE_KILL_GC_REFS, LSRA_EVENT_NO_GC_KILLS,

// Block boundaries
LSRA_EVENT_START_BB, LSRA_EVENT_END_BB,
Expand Down

0 comments on commit d5e2081

Please sign in to comment.