JIT: Eliminate RegTracker #10414
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
good first issue
Issue should be easy to implement, good for first-time contributors
help wanted
[up-for-grabs] Good issue for external contributors
Now that
LEGACY_BACKEND
has been eliminated, theRegTracker
is not longer useful. It was used by the legacy backend to avoid reloading local variables or setting a register to a constant if it was already available in a register. Some constant reuse has been implemented in the register allocator, and future work to support reuse of (memory-based) locals or constants would be done elsewhere (e.g. see issue #6264).Currently the
RegTracker
methods only callregSet->rsSetRegsModified()
, however the register allocator should already be doing this for any registers it allocates, as well as any registers killed by an instruction. Furthermore, the code generator should already be doing this for any additional registers used, for example, in prolog or epilog code.Calls to these methods should be replaced with methods on
RegSet
that simply verify that the register is in the modified set, and assert otherwise (and would be a no-op in retail builds), e.g.:RegSet::verifyRegUsed(regNumber reg)
RegTracker::rsTrackRegTrash()
,RegTracker::rsTrackRegIntCns()
,RegTracker::rsTrackRegLclVar()
andRegTracker::rsTrackRegCopy()
.RegSet::verifyRegistersUsed(regMaskTP regMask)
RegTracker::rsTrashRegSet()
The text was updated successfully, but these errors were encountered: