Conversation
When ldelema is imported in a shared generic inlinee, the array tree only knows the __Canon[] type, while the stack type was resolved in the exact context. Fall back to it so CORINFO_HELP_LDELEMA_REF can be skipped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 569c0a24-cd54-4744-af08-35c084720ae3
|
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. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
Author
Member
Author
|
@MihuBot -nuget |
Member
Author
|
Doesn't look to be worth it |
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.
When
ldelemais imported inside a shared generic inlinee (e.g.ref _items[i]inMyList<T>), the array tree only knows__Canon[], so the existing "T[] with exact T" check fails and we emitCORINFO_HELP_LDELEMA_REF. The importer's stack type for that array was resolved in the exact context (Instruction[]), so use it as a fallback.G_M40277_IG01: sub rsp, 40 G_M40277_IG02: - mov rcx, gword ptr [rcx+0x08] - movsxd rdx, edx - mov r8, 0x7FFB49FFA3E0 ; Instruction - call [CORINFO_HELP_LDELEMA_REF] - nop + mov rax, gword ptr [rcx+0x08] + cmp edx, dword ptr [rax+0x08] + jae SHORT G_M40277_IG04 + mov ecx, edx + lea rax, bword ptr [rax+8*rcx+0x10] G_M40277_IG03: add rsp, 40 ret +G_M40277_IG04: + call CORINFO_HELP_RNGCHKFAIL + int3