Skip to content

Conversation

@AndyAyersMS
Copy link
Member

Follow up to #113977

  • use printfAlloc in a few places
  • move escape-analysis specific layout code to objectalloc.cpp
  • use custom layout for stack allocated boxes
  • use layout a bit more broadly in objectalloc.cpp

Addresses JIT side of #114204 -- I have not altered the VM or jit interface yet, to allow this PR to be easily diffable.

@Copilot Copilot AI review requested due to automatic review settings April 15, 2025 23:06
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

// allocObj - GT_ALLOCOBJ that will be replaced by a stack allocation
// clsHnd - class representing the stack allocated object
// isValueClass - we are stack allocating a boxed value class
// layout - layout for the stack allocated objectd
Copy link

Copilot AI Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the comment: 'objectd' should be corrected to 'object'.

Suggested change
// layout - layout for the stack allocated objectd
// layout - layout for the stack allocated object

Copilot uses AI. Check for mistakes.
@dotnet-policy-service
Copy link
Contributor

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

@AndyAyersMS
Copy link
Member Author

@jakobbotsch PTAL
cc @dotnet/jit-contrib

One diff locally. A boxed object had padding that is now properly modelled during promotion, leading to slightly better code.

SPMI misses since we now call getTypeForBox instead of getTypeForBoxOnStack


if (isValueClass)
{
CORINFO_CLASS_HANDLE boxedClsHnd = comp->info.compCompHnd->getTypeForBox(clsHnd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this purely for correct handling of nullables?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@AndyAyersMS
Copy link
Member Author

Linux x64 failure might be related, let me see if I can repro it.

@AndyAyersMS
Copy link
Member Author

No luck with runfo bits so far. Going to retry CI.

@AndyAyersMS AndyAyersMS merged commit 4ea3cb1 into dotnet:main Apr 16, 2025
110 of 112 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants