Skip to content

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

@kunalspathak

Description

@kunalspathak

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.

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions