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

Finish treating the Unsafe APIs as JIT intrinsics #69220

Open
tannergooding opened this issue May 12, 2022 · 5 comments
Open

Finish treating the Unsafe APIs as JIT intrinsics #69220

tannergooding opened this issue May 12, 2022 · 5 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@tannergooding
Copy link
Member

tannergooding commented May 12, 2022

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

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

ghost commented May 12, 2022

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

Issue Details

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

The remaining unhandled ones are:

  • NI_SRCS_UNSAFE_Copy
  • NI_SRCS_UNSAFE_CopyBlock
  • NI_SRCS_UNSAFE_CopyBlockUnaligned
  • NI_SRCS_UNSAFE_InitBlock
  • NI_SRCS_UNSAFE_InitBlockUnaligned
  • NI_SRCS_UNSAFE_Read
  • NI_SRCS_UNSAFE_ReadUnaligned
  • NI_SRCS_UNSAFE_Unbox
  • NI_SRCS_UNSAFE_Write
  • NI_SRCS_UNSAFE_WriteUnaligned

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

Author: tannergooding
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jkotas
Copy link
Member

jkotas commented May 12, 2022

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).

@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label May 14, 2022
@JulieLeeMSFT JulieLeeMSFT added this to the Future milestone May 14, 2022
@JulieLeeMSFT
Copy link
Member

Cc @dotnet/jit-contrib.

@deeprobin
Copy link
Contributor

Is this easy for JIT-newbies?

MichalPetryka added a commit to MichalPetryka/runtime that referenced this issue Jul 17, 2022
Intrinsifies Copy, Read/ReadUnaligned, Write/WriteUnaligned.

Contributes to dotnet#69220
@MichalPetryka
Copy link
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
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

5 participants