JIT: expand multi-dimensional array intrinsics for large and struct elements - #131750
Merged
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
…lements Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CoreCLR performance issue causing FPS drop in iOS game
JIT: expand multi-dimensional array intrinsics for large and struct elements
Aug 3, 2026
jakobbotsch
reviewed
Aug 3, 2026
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
2 tasks
3 tasks
Member
|
If we're going to do this we might also want to consider #129455. |
Member
jakobbotsch
marked this pull request as ready for review
August 5, 2026 09:21
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
PTAL @dotnet/jit-contrib |
AndyAyersMS
approved these changes
Aug 5, 2026
jakobbotsch
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On platforms without a JIT (e.g. iOS with R2R), a multi-dimensional array access that
impArrayAccessIntrinsicdeclines to expand becomes a real call to theArrayintrinsic method, which falls back to the interpreter. Two of those bailouts are unnecessary.Widen
gtArrElemSizeGenTreeArrElem::gtArrElemSizewas anunsigned char, so the importer bailed out whenever the element size exceeded 255 bytes. The field (and the constructor parameter) is nowunsigned, and theFitsIn<unsigned char>check is removed. All consumers already read it into anunsigned.Support struct-typed
NI_Array_Seta[i, j, k] = someStructwas rejected as an implementation limitation. It is now imported the same wayCEE_STOBJis:Value-type arrays are invariant, so the covariance check that guards the
varTypeIsGCpath is not needed here.Test
JIT/Regression/JitBlue/Runtime_131371covers get/set/address on rank-2 and rank-3 arrays for a small struct, a 304-byte struct, and a 304-byte struct containing a GC reference, plus bounds-check behavior.For a 304-byte element type,
SetLargenow imports asSTORE_BLK struct<LargeStruct, 304>over anARR_ELEM[,,]instead of emitting a call. Validated on linux-x64 underJitStress1/2/0x1F/0x3F andGCStress=0xC; existingJIT/Methodicalgroups (which include theMDArraytests) pass. Not exercised on arm64 or iOS.