Skip to content

Unsafe.SizeOf<T>() causes an additional mov over sizeof(T) #55472

Closed

Description

@MichalPetryka

Description

In some cases, Unsafe.SizeOf<T> produces an additional mov over sizeof(T) (both over not compile time known types).

Configuration

Sharplab Core CLR v5.0.721.25508

Regression?

No idea.

Data

Sharplab

Activity

  1. added
    tenet-performance
    on Jul 11, 2021
  2. ghost added
    untriaged
    on Jul 11, 2021
  3. added
    area-CodeGen-coreclr
    on Jul 11, 2021
  4. GrabYourPitchforks commented on Jul 11, 2021

    @GrabYourPitchforks
    Member

    @jkotas There's an existing proposal to move the Unsafe type down to corelib. Might this issue be resolved as a side effect of that work?

  5. jkotas commented on Jul 11, 2021

    @jkotas
    Member

    proposal to move the Unsafe type down to corelib.

    ... and turn it into JIT intrinsic. I agree that turning Unsafe into JIT intrinsic is likely to fix this issue.

  6. AndyAyersMS commented on Jul 12, 2021

    @AndyAyersMS
    Member

    Also likely to be fixed if/when we implement forward sub (#6973)

  7. removed
    untriaged
    on Jul 12, 2021
  8. added this to the Future milestone on Jul 12, 2021
  9. ghost added
    in-pr
    on Jan 13, 2022
  10. added a commit that references this issue on Feb 4, 2022
    99dcf5b
  11. ghost removed
    in-pr
    on Feb 4, 2022
  12. ghost locked as resolved and limited conversation to collaborators on Mar 6, 2022
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-coreclrtenet-performance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions