JIT: expand multi-dimensional array intrinsics for large and struct elements - #131750
Draft
jakobbotsch with Copilot wants to merge 4 commits into
Draft
JIT: expand multi-dimensional array intrinsics for large and struct elements#131750jakobbotsch with Copilot wants to merge 4 commits into
jakobbotsch with Copilot wants to merge 4 commits into
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
Member
There was a problem hiding this comment.
@copilot This should not be a regression test, look for another place to add this. Perhaps under src/tests/JIT/opt somewhere.
Contributor
Author
There was a problem hiding this comment.
Moved to src/tests/JIT/opt/MDArray/MDArrayIntrinsicExpansion.cs (with its own csproj, picked up by the JIT.opt merged wrapper) in 3d24d3d. Note: I did not rebuild/run the test after the move — no coreclr artifacts in this environment.
Note
This reply was generated by GitHub Copilot.
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. |
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.