Skip to content

RyuJIT: Allow promotions of structs with fields of struct containing a single primitive field. #7441

Closed

Description

@sivarv

Right now the existing implementation allows only structs with pointer sized fields. This would mean int/uint/ref/byref on 32-bit and long/ulong/ref/byref on 64-bit. We should be able to permit promotion of a following struct on 64-bit, for example

struct Foo { struct Bar { int a }, int b}

Similarly the following struct both on 32-bit and 64-bit targets

struct Foo { struct Bar { short a }, short b, int c }
category:cq
theme:structs
skill-level:expert
cost:medium

Activity

  1. self-assigned this
    on Feb 14, 2017
  2. AndreyAkinshin commented on Feb 15, 2017

    @AndreyAkinshin
    Member
  3. JosephTremoulet commented on Aug 18, 2017

    @JosephTremoulet
    Contributor

    n.b. I think this was filed because it would be a smallish step implementation-wise, not to target a particular code sequence, so we'd probably want to pick this up as part of a bigger push to remove artificial limitations in our struct promotion (which we generally want to do because using structs to avoid heap allocation shouldn't cause code quality degradation), not for its own sake.

  4. AndreyAkinshin commented on Aug 18, 2017

    @AndreyAkinshin
    Member

    @JosephTremoulet,

    so we'd probably want to pick this up as part of a bigger push to remove artificial limitations in our struct promotion

    LGTM.

  5. removed their assignment
    on Sep 14, 2017
  6. transferred this issue fromdotnet/coreclron Jan 31, 2020
  7. added this to the Future milestone on Jan 31, 2020
  8. jakobbotsch commented on Dec 15, 2022

    @jakobbotsch
    Member

    I believe we are able to do this today, they don't need to be pointer sized anymore.

  9. ghost locked as resolved and limited conversation to collaborators on Jan 14, 2023
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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions