Skip to content

Remove CORINFO_HELP_ASSIGN_BYREF ? #128227

Closed

Description

@EgorBo

#128225 reminded me - can we delete this version of write barrier and use normal checked/unchecked? Maybe long-term even just leave the unchecked one and inline checks in JIT for the checked one?

Currently, we have 5 flavors:

CORINFO_HELP_ASSIGN_REF,
CORINFO_HELP_CHECKED_ASSIGN_REF,
CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP,  // Debug only, do we use it?
CORINFO_HELP_ASSIGN_BYREF,
CORINFO_HELP_BULK_WRITEBARRIER,

CORINFO_HELP_ASSIGN_BYREF was beneficial for large struct copies with GC fields due to custom calling convention that bumps pointer, but it's no longer that important with the introduction of CORINFO_HELP_BULK_WRITEBARRIER

Opinions @jkotas @dotnet/jit-contrib?

Activity

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on May 14, 2026
  2. dotnet-policy-service commented on May 14, 2026

    @dotnet-policy-service
    Contributor

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

  3. EgorBo commented on May 14, 2026

    @EgorBo
    MemberAuthor
    Image

    Also, shouldn't JIT prefer unchecked WB here (it's in a class).
    PS: if that makes sense, we can also introduce an unchecked version of the bulk barrier as well.

  4. jkotas commented on May 14, 2026

    @jkotas
    Member

    CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP

    IIRC, it was used by JIT stress at some point. If we are not using it anymore, it is fine to delete it.

    CORINFO_HELP_ASSIGN_BYREF

    If the codediff numbers show that it is not a meaningful improvement anymore, deleting it is fine with me.

    inline checks in JIT for the checked one?

    This is code bloating optimization. We may do it for very hot code. I do not think we would want to do that by default, or for AOT where these checks would have to go through indirections.

    we can also introduce an unchecked version of the bulk barrier as well.

    I doubt that it is worth it. The extra work in checked bulk write barrier is fairly small compared to the work that it needs to do to perform the bulk update.

  5. added this to the Future milestone on May 14, 2026
  6. removed
    untriagedNew issue has not been triaged by the area owner
    on May 14, 2026
  7. EgorBo commented on Jun 2, 2026

    @EgorBo
    MemberAuthor

    Removed in main now.

  8. modified the milestones: Future, 11.0.0 on Jun 2, 2026
  9. self-assigned this
    on Jun 2, 2026
  10. locked and limited conversation to collaborators on Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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