Skip to content

Finish treating the Unsafe APIs as JIT intrinsics #69220

Open

Description

@tannergooding

A majority of the APIs on System.Runtime.CompilerServices.Unsafe were converted to be JIT intrinsics as part of #68739 and later more as part of #85562

The remaining unhandled ones are:

  • NI_SRCS_UNSAFE_CopyBlock
  • NI_SRCS_UNSAFE_CopyBlockUnaligned
  • NI_SRCS_UNSAFE_InitBlock
  • NI_SRCS_UNSAFE_InitBlockUnaligned
  • NI_SRCS_UNSAFE_Unbox

We should ensure these are likewise handled as JIT intrinsics to further improve code quality and JIT throughput where possible

category:implementation
theme:intrinsics
skill-level:intermediate
cost:small
impact:small

Activity

  1. ghost added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on May 12, 2022
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on May 12, 2022
  3. jkotas commented on May 12, 2022

    @jkotas
    Member

    Once this is done, we can switch these intrinsics onto the same plan as hardware intrinsics, implement them using self-recursive pattern in C# and delete the IL intrinsic expansion in VM/AOT (getILIntrinsicImplementationForUnsafe and Internal.IL.Stubs.UnsafeIntrinsics).

  4. removed
    untriagedNew issue has not been triaged by the area owner
    on May 14, 2022
  5. added this to the Future milestone on May 14, 2022
  6. JulieLeeMSFT commented on May 14, 2022

    @JulieLeeMSFT
    Member

    Cc @dotnet/jit-contrib.

  7. deeprobin commented on May 24, 2022

    @deeprobin
    Contributor

    Is this easy for JIT-newbies?

  8. MichalPetryka commented on Jul 23, 2023

    @MichalPetryka
    Contributor

    NI_SRCS_UNSAFE_Copy, NI_SRCS_UNSAFE_Read, NI_SRCS_UNSAFE_ReadUnaligned, NI_SRCS_UNSAFE_Write and NI_SRCS_UNSAFE_WriteUnaligned can be removed from the list now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions