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

Fold "FrozenObjectHandle(REF) + CNS" to a byref constant #85888

Merged
merged 7 commits into from
May 9, 2023

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented May 7, 2023

Let's see if any target complains about it. This removes two "add" instructions from #85880 snippet, or e.g.:

ReadOnlySpan<char> Test() => "Hello World"

was:

; Method Program:Test():System.ReadOnlySpan`1[ushort]:this
       mov      rax, 0x14380209280      ; 'Hello World'
       add      rax, 12 ; offset to string's data
       mov      edx, 11 ; Length
       ret      
; Total bytes of code: 20

now:

; Method Program:Test():System.ReadOnlySpan`1[ushort]:this
       mov      rax, 0x29C8020928C ;;  "interior pointer"
       mov      edx, 11 ; Length
       ret      
; Total bytes of code: 16

Diffs.

@ghost ghost assigned EgorBo May 7, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 7, 2023
@ghost
Copy link

ghost commented May 7, 2023

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

Issue Details

Let's see if any target complains about it. This removes two "add" instructions from #85880 snippet, or e.g.:

ReadOnlySpan<char> Test() => "Hello World"

was:

; Method Program:Test():System.ReadOnlySpan`1[ushort]:this
       mov      rax, 0x14380209280      ; 'Hello World'
       add      rax, 12
       mov      edx, 11
       ret      
; Total bytes of code: 20

now:

; Method Program:Test():System.ReadOnlySpan`1[ushort]:this
       mov      rax, 0x29C8020928C
       mov      edx, 11
       ret      
; Total bytes of code: 16
Author: EgorBo
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: -

@azure-pipelines

This comment was marked as resolved.

@EgorBo
Copy link
Member Author

EgorBo commented May 7, 2023

/azp run runtime-coreclr outerloop, runtime-coreclr jitstress, runtime-coreclr jitstressregs, runtime-coreclr gcstress0x3-gcstress0xc

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@EgorBo EgorBo marked this pull request as ready for review May 7, 2023 20:44
@EgorBo
Copy link
Member Author

EgorBo commented May 7, 2023

/azp run runtime-coreclr outerloop, runtime-coreclr gcstress0x3-gcstress0xc

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@EgorBo
Copy link
Member Author

EgorBo commented May 8, 2023

@dotnet/jit-contrib PTAL simple change with nice diffs, outerloop/jitstress/gcstress tests passed

@EgorBo
Copy link
Member Author

EgorBo commented May 9, 2023

@jakobbotsch PTAL

@EgorBo EgorBo requested a review from jakobbotsch May 9, 2023 13:13
@EgorBo EgorBo merged commit e338820 into dotnet:main May 9, 2023
@EgorBo EgorBo deleted the fold-frozen-obj-cns branch May 9, 2023 14:07
@ghost ghost locked as resolved and limited conversation to collaborators Jun 8, 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 this pull request may close these issues.

2 participants