Skip to content

Conversation

@jakobbotsch
Copy link
Member

For interface tail calls we need to allocate registers for both the
target and a null-check. The register that can be used for the target is
highly constrained: it essentially only go into r12 as the arg registers
may be busy and that is the only volatile register left that will not be
overridden by the epilog. This leaves
just LR left for the null check, and LSRA does not seem to handle the
low amount of freedom too well (these are all allocated at the same
location, which might have something to do with it).

To help LSRA just force the null-check to happen with LR for fast
tailcalls, which is going to be killed going into the epilog anyway.

Fix #66563

cc @dotnet/jit-contrib @kunalspathak, this is the alternative fix

For interface tail calls we need to allocate registers for both the
target and a null-check. The register that can be used for the target is
highly constrained: it essentially only go into r12 as the arg registers
may be busy and that is the only volatile register left that will not be
overridden by the epilog. This leaves
just `LR` left for the null check, and LSRA does not seem to handle the
low amount of freedom too well (these are all allocated at the same
location, which might have something to do with it).

To help LSRA just force the null-check to happen with LR for fast
tailcalls, which is going to be killed going into the epilog anyway.

Fix dotnet#66563
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 16, 2022
@ghost ghost assigned jakobbotsch Apr 16, 2022
@ghost
Copy link

ghost commented Apr 16, 2022

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

Issue Details

For interface tail calls we need to allocate registers for both the
target and a null-check. The register that can be used for the target is
highly constrained: it essentially only go into r12 as the arg registers
may be busy and that is the only volatile register left that will not be
overridden by the epilog. This leaves
just LR left for the null check, and LSRA does not seem to handle the
low amount of freedom too well (these are all allocated at the same
location, which might have something to do with it).

To help LSRA just force the null-check to happen with LR for fast
tailcalls, which is going to be killed going into the epilog anyway.

Fix #66563

cc @dotnet/jit-contrib @kunalspathak, this is the alternative fix

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Contributor

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kunalspathak kunalspathak merged commit 928bd97 into dotnet:main Apr 18, 2022
directhex pushed a commit to directhex/runtime that referenced this pull request Apr 21, 2022
For interface tail calls we need to allocate registers for both the
target and a null-check. The register that can be used for the target is
highly constrained: it essentially only go into r12 as the arg registers
may be busy and that is the only volatile register left that will not be
overridden by the epilog. This leaves
just `LR` left for the null check, and LSRA does not seem to handle the
low amount of freedom too well (these are all allocated at the same
location, which might have something to do with it).

To help LSRA just force the null-check to happen with LR for fast
tailcalls, which is going to be killed going into the epilog anyway.

Fix dotnet#66563
@ghost ghost locked as resolved and limited conversation to collaborators May 18, 2022
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 this pull request may close these issues.

Test failure JIT/Regression/JitBlue/DevDiv_461649/DevDiv_461649/DevDiv_461649.sh

2 participants