Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Eliminate RegTracker #10414

Closed
CarolEidt opened this issue May 29, 2018 · 2 comments
Closed

JIT: Eliminate RegTracker #10414

CarolEidt opened this issue May 29, 2018 · 2 comments
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

Comments

@CarolEidt
Copy link
Contributor

Now that LEGACY_BACKEND has been eliminated, the RegTracker 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 call regSet->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)

    • this would replace calls to RegTracker::rsTrackRegTrash(), RegTracker::rsTrackRegIntCns(), RegTracker::rsTrackRegLclVar() and RegTracker::rsTrackRegCopy().
  • RegSet::verifyRegistersUsed(regMaskTP regMask)

    • this would replace calls to RegTracker::rsTrashRegSet()
@CarolEidt
Copy link
Contributor Author

This issue would be a good "getting started" project for someone wanting to gain familiarity with the JIT. It would be good to build coreclr on your chosen target, and to read the JIT overview and tutorial documents: https://github.com/dotnet/coreclr/blob/master/Documentation/botr/ryujit-overview.md and https://github.com/dotnet/coreclr/blob/master/Documentation/botr/ryujit-tutorial.md

@CarolEidt
Copy link
Contributor Author

Closing this, and transfering comments to #10411

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

1 participant