Uh oh!
There was an error while loading. Please reload this page.
NativeAOT: avoid helper calls for static fields - #79709
Conversation
ghost
commented
Dec 15, 2022
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsBased on #63620 for non-gc fields for now (looking into gc now) staticints;staticintGetS()=>s;Was: 4883EC28 subrsp,40 E800000000 call CORINFO_HELP_READYTORUN_NONGCSTATIC_BASE 8B00 moveax, dword ptr [rax] 4883C428 addrsp,40 C3 ret; Total bytes of code 16Now: 8B0500000000 moveax, dword ptr [(reloc 0x4000000000425290)] C3 ret; Total bytes of code 7
|
EgorBo
commented
Dec 15, 2022
/azp list |
This comment was marked as outdated.
This comment was marked as outdated.
EgorBo
commented
Dec 15, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Nice! Does it help property initializers in R2R as well: https://godbolt.org/z/EvTjxcG9a ( |
EgorBo
commented
Dec 15, 2022
This is optimized to just |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ativeaot # Conflicts: # src/coreclr/inc/jiteeversionguid.h
EgorBo
commented
Jan 6, 2023
@jakobbotsch @dotnet/jit-contrib PTAL the JIT side, I'll handle statics of GC types separately due to additional complexity (double indirect + new type of const handle in jit for it). @MichalStrehovsky PTAL NAOT side, it's copied from your PR 🙂 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MichalStrehovsky
left a comment
There was a problem hiding this comment.
The AOT side looks good!
I think we'd also be able to do the case when the bases are accessed from shared code if we changed pResult->fieldLookup from CORINFO_CONST_LOOKUP to CORINFO_LOOKUP.
The compiler side can compute the lookup with ComputeLookup(ref pResolvedToken, field.OwningType, ReadyToRunHelperId.GetNonGCStaticBase, ref pResult->fieldLookup).
It can also be done separately, just want to make sure the JIT side doesn't make assumptions that would make it more difficult.
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
… into static-fields-nativeaot
EgorBo
commented
Jan 9, 2023
@SingleAccretion thanks for the review, can you look again please? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
EgorBo
commented
Jan 14, 2023
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
EgorBo
commented
Jan 15, 2023
@SingleAccretion can you please take another look? Failures in |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Based on #63620 for non-gc fields for now (looking into gc now)
Was:
Now: