Skip to content

Comments

Remove unused emitter call types and improve INS_tail_i_jmp handling#59495

Merged
jakobbotsch merged 3 commits intodotnet:mainfrom
jakobbotsch:clean-up-call-emission
Sep 24, 2021
Merged

Remove unused emitter call types and improve INS_tail_i_jmp handling#59495
jakobbotsch merged 3 commits intodotnet:mainfrom
jakobbotsch:clean-up-call-emission

Conversation

@jakobbotsch
Copy link
Member

The size estimation for INS_tail_i_jmp instructions was working by
accident: we were always regarding these as requiring rex.w
prefixes, even when they did not. Fix the logic so that rex.w is not
considered required for 8-byte tail jumps, but add it manually for the
forms where it is really necessary.

There were also a lot of unused emitter call types that I have removed.

cc @dotnet/jit-contrib

The size estimation for INS_tail_i_jmp instructions was working by
accident: we were always regarding these as requiring rex.w
prefixes, even when they did not. Fix the logic so that rex.w is not
considered required for 8-byte tail jumps, but add it manually for the
forms where it is really necessary.

There were also a lot of unused emitter call types that I have removed.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 22, 2021
@ghost
Copy link

ghost commented Sep 22, 2021

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

Issue Details

The size estimation for INS_tail_i_jmp instructions was working by
accident: we were always regarding these as requiring rex.w
prefixes, even when they did not. Fix the logic so that rex.w is not
considered required for 8-byte tail jumps, but add it manually for the
forms where it is really necessary.

There were also a lot of unused emitter call types that I have removed.

cc @dotnet/jit-contrib

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Contributor

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM.

asm diffs?

// EC_FUNC_TOKEN_INDIR, // Indirect call to a helper/static/nonvirtual/global method
EC_FUNC_ADDR, // Direct call to an absolute address

// EC_FUNC_VIRTUAL, // Call to a virtual method (using the vtable)
Copy link
Contributor

Choose a reason for hiding this comment

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

At this point, I think there's not much point in keeping all the non-ARM cases here. They were initially left in during the port to make it easier to compare to x86. If you're going to delete this, I would delete the other commented-out cases (EC_FUNC_TOKEN_INDIR, EC_INDIR_SR, etc.), as well as the huge comment just above.

// EC_FUNC_VIRTUAL, // Call to a virtual method (using the vtable)
EC_INDIR_R, // Indirect call via register
// EC_INDIR_SR, // Indirect call via stack-reference (local var)
// EC_INDIR_C, // Indirect call via static class var
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here about deleting non-arm cases

@jakobbotsch
Copy link
Member Author

asm diffs?

No diffs on {x64, arm64}x{windows, linux}.

@jakobbotsch
Copy link
Member Author

Failures are #59541

@jakobbotsch jakobbotsch merged commit 84a6225 into dotnet:main Sep 24, 2021
@jakobbotsch jakobbotsch deleted the clean-up-call-emission branch September 24, 2021 13:47
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
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.

2 participants