Uh oh!
There was an error while loading. Please reload this page.
Allow some intrinsics in Tier0 - #77357
Conversation
ghost
commented
Oct 23, 2022
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsAs it turns out, even extremely hot methods may stuck in Tier0 for several seconds (see #70941 (comment)) pending call-counting stub installation. So we'd better optimize Enum.HasFlag in tier0 too because it allocates and produces a large tree, e.g.: boolTest(MyEnume)=>e.HasFlag(MyEnum.B);Current Tier0 codegen: ; Assembly listing for method Program:Test(int):bool:this; Emitting BLENDED_CODE for X64 CPU with AVX - Windows; Tier-0 compilation; MinOpts code; rbp based frame; partially interruptibleG_M000_IG01: ;; offset=0000H55pushrbp 4883EC30 subrsp,48 488D6C2430 learbp,[rsp+30H] 33C0 xoreax,eax 488945F8 mov qword ptr [rbp-08H],rax 488945F0 mov qword ptr [rbp-10H],rax 48894D10 mov gword ptr [rbp+10H],rcx895518mov dword ptr [rbp+18H], edG_M000_IG02: ;; offset=001BH 48B928667DEAFD7F0000 movrcx,0x7FFDEA7D6628 E8E6C0AB5F call CORINFO_HELP_NEWSFAST 488945F8 mov gword ptr [rbp-08H],rax 488B4DF8 movrcx, gword ptr [rbp-08H] 8B4518 moveax, dword ptr [rbp+18H]894108mov dword ptr [rcx+08H],eax 48B928667DEAFD7F0000 movrcx,0x7FFDEA7D6628 E8C9C0AB5F call CORINFO_HELP_NEWSFAST 488945F0 mov gword ptr [rbp-10H],rax 488B4DF0 movrcx, gword ptr [rbp-10H] C7410801000000 mov dword ptr [rcx+08H],1 488B4DF8 movrcx, gword ptr [rbp-08H] 488B55F0 movrdx, gword ptr [rbp-10H] FF15DCF0F4FF call[System.Enum:HasFlag(System.Enum):bool:this]90nopG_M000_IG03: ;; offset=0065H 4883C430 addrsp,48 5D poprbp C3 ret; Total bytes of code 107New tier0 codegen: ; Assembly listing for method Program:Test(int):bool:this; Emitting BLENDED_CODE for X64 CPU with AVX - Windows; Tier-0 compilation; MinOpts code; rbp based frame; partially interruptibleG_M57656_IG01: ;; offset=0000H55pushrbp 4883EC20 subrsp,32 488D6C2420 learbp,[rsp+20H] 33C0 xoreax,eax 488945F8 mov qword ptr [rbp-08H],rax 488945F0 mov qword ptr [rbp-10H],rax 48894D10 mov gword ptr [rbp+10H],rcx895518mov dword ptr [rbp+18H],edxG_M57656_IG02: ;; offset=001BH 8B4518 moveax, dword ptr [rbp+18H] 8945EC mov dword ptr [rbp-14H],eax 8B45EC moveax, dword ptr [rbp-14H] 83E001 andeax,1 83F801 cmpeax,1 0F94C0 sete al 0FB6C0 movzxrax,alG_M57656_IG03: ;; offset=0030H 4883C420 addrsp,32 5D poprbp C3 ret; Total bytes of code 54Also, allow expansion for some other lightweight intrinsics for two reasons:
|
Uh oh!
There was an error while loading. Please reload this page.
Avalonia's version of |
AndyAyersMS
commented
Oct 23, 2022
Linking to #9120. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
BruceForstall
commented
Nov 28, 2022
@EgorBo No activity on this for a while. Do you want to convert it to Draft until it is ready? Or are you waiting on more reviews? |
EgorBo
commented
Nov 28, 2022
Yes, it's blocked on the other PR to introduce opt levels. |
ghost
commented
Dec 28, 2022
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
EgorBo
commented
Feb 11, 2023
Diffs are negative (MinOpts only): https://dev.azure.com/dnceng-public/public/_build/results?buildId=167821&view=ms.vss-build-web.run-extensions-tab |
Plaintext-plaintext, Tier0 instrumented:Mainly due to |
Even better numbers for YARP, start time is also decreased! |
EgorBo
commented
Feb 12, 2023
PTAL @AndyAyersMS @dotnet/jit-contrib |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
EgorBo
commented
Feb 13, 2023
ping @AndyAyersMS@jakobbotsch - I need this to land for my next pr 🙂 |
jakobbotsch
left a comment
There was a problem hiding this comment.
Looks like a reasonable set to expand to me.
AndyAyersMS
commented
Feb 14, 2023
@EgorBo sorry I missed seeing this. Going forward can you assign me as reviewer? Otherwise I may not look in the right places. Also if you have copies of your evaluation scripts laying around, point me at them. |
This reverts commit e1edb16.
BruceForstall
commented
Feb 14, 2023
This caused outerloop regressions: #82078 |


Expand some intrinsics in Tier0, e.g. these:
Plaintext-plaintext, Tier0 instrumented:
Mainly due to
Span.get_Itemandtypeof() == typeof()E.g. here is Main's codegen for
typeof():This PR fixes it to just
return false