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

JIT should be able to elide zeroing of fields after allocations #96942

Open
jakobbotsch opened this issue Jan 13, 2024 · 2 comments
Open

JIT should be able to elide zeroing of fields after allocations #96942

jakobbotsch opened this issue Jan 13, 2024 · 2 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@jakobbotsch
Copy link
Member

using System;

class Program
{
    static void Main()
    {
        Program p = new();
        p.Test = false;
    }

    public bool Test;
}

Codegen:

       call     CORINFO_HELP_NEWSFAST
       mov      byte  ptr [rax+0x08], 0

Expected:

       call     CORINFO_HELP_NEWSFAST

I looked at representing this in VN once, but it seemed hard with how we represent memory in VN.

@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 Jan 13, 2024
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 13, 2024
@ghost
Copy link

ghost commented Jan 13, 2024

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

Issue Details
using System;

class Program
{
    static void Main()
    {
        Program p = new();
        p.Test = false;
    }

    public bool Test;
}

Codegen:

       call     CORINFO_HELP_NEWSFAST
       mov      byte  ptr [rax+0x08], 0

Expected:

       call     CORINFO_HELP_NEWSFAST

I looked at representing this in VN once, but it seemed hard with how we represent memory in VN.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch jakobbotsch removed the untriaged New issue has not been triaged by the area owner label Jan 13, 2024
@jakobbotsch jakobbotsch self-assigned this Jan 13, 2024
@jakobbotsch jakobbotsch added this to the 9.0.0 milestone Jan 13, 2024
@EgorBo
Copy link
Member

EgorBo commented Jan 13, 2024

... and remove the allocation after it 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

2 participants