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

Optimize the iteration over all registers in various places in LSRA #87337

Closed
kunalspathak opened this issue Jun 9, 2023 · 1 comment · Fixed by #87424
Closed

Optimize the iteration over all registers in various places in LSRA #87337

kunalspathak opened this issue Jun 9, 2023 · 1 comment · Fixed by #87424
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@kunalspathak
Copy link
Member

As a continuation of #83109, I audited the places where we iterate over all the registers in LSRA code base. I would categorize it:

  • Most of them are in #ifdef DEBUG

  • Few are at the beginning of methods like allocateRegister() and resolveRegister(). The one in allocateRegister() can be done better during RegisterRecord initialization perhaps or creating intervals.

  • Then, there are instances where they happen during building interval or allocation.

    • In resetAllRegistersState(), we reset the assigned interval at block boundaries for minopts.
    • In processStartBlockStartLocations(), we can optimize it to just iterate on liveRegs mask with bitwise iterator instead of for-loop.
    • In addRefsForPhysRegMask() - Used during kill positions, Here too, should be able to use bitwise iterator or bitscanforward technique.
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 9, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 9, 2023
@kunalspathak kunalspathak self-assigned this Jun 9, 2023
@kunalspathak kunalspathak added this to the Future milestone Jun 9, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jun 9, 2023
@kunalspathak kunalspathak added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jun 9, 2023
@ghost
Copy link

ghost commented Jun 9, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

As a continuation of #83109, I audited the places where we iterate over all the registers in LSRA code base. I would categorize it:

  • Most of them are in #ifdef DEBUG

  • Few are at the beginning of methods like allocateRegister() and resolveRegister(). The one in allocateRegister() can be done better during RegisterRecord initialization perhaps or creating intervals.

  • Then, there are instances where they happen during building interval or allocation.

    • In resetAllRegistersState(), we reset the assigned interval at block boundaries for minopts.
    • In processStartBlockStartLocations(), we can optimize it to just iterate on liveRegs mask with bitwise iterator instead of for-loop.
    • In addRefsForPhysRegMask() - Used during kill positions, Here too, should be able to use bitwise iterator or bitscanforward technique.
Author: kunalspathak
Assignees: kunalspathak
Labels:

area-CodeGen-coreclr

Milestone: Future

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 12, 2023
@kunalspathak kunalspathak modified the milestones: Future, 8.0.0 Jun 12, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 19, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 20, 2023
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant