JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

JIT: Fully share helper-based suspension tails - #126360

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails
Apr 29, 2026
Merged

JIT: Fully share helper-based suspension tails#126360
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fully-share-suspension-tails

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Mar 31, 2026

Copy link
Copy Markdown
Member

When multiple awaits have common context handling logic during suspension we can share that logic completely by jumping to a common block. This PR implements that size optimization.

privatestaticasyncTaskFoo(){awaitBar();awaitBar();awaitBar().ConfigureAwait(false);awaitBar().ConfigureAwait(false);}
Codegen diff
@@ -11,10 +11,10 @@
; 1 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
;
-; V00 AsyncCont [V00,T01] ( 17, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"+; V00 AsyncCont [V00,T01] ( 15, 4 ) ref -> [rbp+0x10] EH-live single-def "Async continuation arg"
; V01 OutArgs [V01 ] ( 1, 1 ) struct (48) [rsp+0x00] do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <UNNAMED>
-; V02 tmp1 [V02,T07] ( 8, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"-; V03 tmp2 [V03,T08] ( 8, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"+; V02 tmp1 [V02,T07] ( 6, 0 ) ref -> [rbp-0x10] must-init ld-addr-op EH-live single-def "Async ExecutionContext"+; V03 tmp2 [V03,T08] ( 6, 0 ) ref -> [rbp-0x18] must-init ld-addr-op EH-live single-def "Async SynchronizationContext"
; V04 tmp3 [V04,T05] ( 3, 3 ) ref -> rax class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
;* V05 tmp4 [V05 ] ( 0, 0 ) ubyte -> zero-ref "Inlining Arg"
; V06 tmp5 [V06,T09] ( 5, 0 ) ref -> rbx class-hnd exact single-def "Inline stloc first use temp" <System.Threading.Thread>
@@ -24,7 +24,7 @@
; V10 rat0 [V10,T04] ( 3, 4 ) byref -> rax "TLS field access"
; V11 rat1 [V11,T03] ( 3, 6 ) long -> rax "TLS access"
; V12 rat2 [V12,T02] ( 3, 6 ) byref -> rax "ThreadStaticBlockBase access"
-; V13 rat3 [V13,T06] ( 30, 0 ) ref -> rbx "new continuation"+; V13 rat3 [V13,T06] ( 26, 0 ) ref -> rbx "new continuation"
; V14 rat4 [V14,T00] ( 15, 8 ) ref -> rcx "returned continuation"
; V15 rat5 [V15,T11] ( 3, 0 ) int -> rax "ReplaceWithLclVar is creating a new local variable"
;
@@ -42,7 +42,7 @@ G_M44929_IG01: ;; offset=0x0000
;; size=25 bbWeight=1 PerfScore 6.00
G_M44929_IG02: ;; offset=0x0019
test rcx, rcx
- jne G_M44929_IG26+ jne G_M44929_IG28
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+0x28]
cmp dword ptr [rax+0x250], 2
@@ -54,8 +54,8 @@ G_M44929_IG02: ;; offset=0x0019
;; size=47 bbWeight=1 PerfScore 13.50
G_M44929_IG03: ;; offset=0x0048
mov rax, gword ptr [rax+0x10]
- mov r8, gword ptr [rax+0x08]- mov gword ptr [rbp-0x10], r8+ mov rdx, gword ptr [rax+0x08]+ mov gword ptr [rbp-0x10], rdx
mov rdx, gword ptr [rax+0x10]
mov gword ptr [rbp-0x18], rdx
;; size=20 bbWeight=1 PerfScore 8.00
@@ -122,26 +122,15 @@ G_M44929_IG13: ;; offset=0x00E0
jmp SHORT G_M44929_IG09
;; size=24 bbWeight=0 PerfScore 0.00
G_M44929_IG14: ;; offset=0x00F8
- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
lea rcx, [reloc @RWD00]
mov qword ptr [rbx+0x10], rcx
mov qword ptr [rbx+0x18], 32
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=91 bbWeight=0 PerfScore 0.00-G_M44929_IG15: ;; offset=0x0153+ ;; size=42 bbWeight=0 PerfScore 0.00+G_M44929_IG15: ;; offset=0x0122
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -151,30 +140,19 @@ G_M44929_IG15: ;; offset=0x0153
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG17
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG16: ;; offset=0x016D- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG16: ;; offset=0x013C+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG17: ;; offset=0x017F+G_M44929_IG17: ;; offset=0x014E
lea rcx, [reloc @RWD16]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x100000020
mov qword ptr [rbx+0x18], rcx
- mov r8, gword ptr [rbp-0x10]- mov gword ptr [rsp+0x20], r8- mov rdx, gword ptr [rbp-0x18]- mov gword ptr [rsp+0x28], rdx- lea rcx, bword ptr [rbx+0x20]- lea rdx, bword ptr [rbx+0x18]- lea r8, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne r9b- movzx r9, r9b- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
jmp G_M44929_IG24
- ;; size=79 bbWeight=0 PerfScore 0.00-G_M44929_IG18: ;; offset=0x01CE+ ;; size=30 bbWeight=0 PerfScore 0.00+G_M44929_IG18: ;; offset=0x016C
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -184,26 +162,19 @@ G_M44929_IG18: ;; offset=0x01CE
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG20
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG19: ;; offset=0x01E8- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG19: ;; offset=0x0186+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG20: ;; offset=0x01FA+G_M44929_IG20: ;; offset=0x0198
lea rcx, [reloc @RWD32]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x200000001
mov qword ptr [rbx+0x18], rcx
- lea rcx, bword ptr [rbx+0x28]- cmp gword ptr [rbp+0x10], 0- setne dl- movzx rdx, dl- mov r8, gword ptr [rbp-0x10]- mov r9, gword ptr [rbp-0x18]- call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]- jmp SHORT G_M44929_IG24- ;; size=56 bbWeight=0 PerfScore 0.00-G_M44929_IG21: ;; offset=0x0232+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG21: ;; offset=0x01B3
mov rax, gword ptr [rbp+0x10]
mov rbx, rax
test rbx, rbx
@@ -213,16 +184,33 @@ G_M44929_IG21: ;; offset=0x0232
call CORINFO_HELP_ASSIGN_REF
jmp SHORT G_M44929_IG23
;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG22: ;; offset=0x024C- mov rdx, 0x7FFAEE674518 ; Continuation_16_0_2+G_M44929_IG22: ;; offset=0x01CD+ mov rdx, 0x7FFAEE504518 ; Continuation_16_0_2
call CORINFO_HELP_ALLOC_CONTINUATION
mov rbx, rax
;; size=18 bbWeight=0 PerfScore 0.00
-G_M44929_IG23: ;; offset=0x025E+G_M44929_IG23: ;; offset=0x01DF
lea rcx, [reloc @RWD48]
mov qword ptr [rbx+0x10], rcx
mov rcx, 0x300000001
mov qword ptr [rbx+0x18], rcx
+ jmp SHORT G_M44929_IG25+ ;; size=27 bbWeight=0 PerfScore 0.00+G_M44929_IG24: ;; offset=0x01FA+ mov r8, gword ptr [rbp-0x10]+ mov gword ptr [rsp+0x20], r8+ mov rdx, gword ptr [rbp-0x18]+ mov gword ptr [rsp+0x28], rdx+ lea rcx, bword ptr [rbx+0x20]+ lea rdx, bword ptr [rbx+0x18]+ lea r8, bword ptr [rbx+0x28]+ cmp gword ptr [rbp+0x10], 0+ setne r9b+ movzx r9, r9b+ call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionWithContinuationContext(byref,byref,byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]+ jmp SHORT G_M44929_IG26+ ;; size=51 bbWeight=0 PerfScore 0.00+G_M44929_IG25: ;; offset=0x022D
lea rcx, bword ptr [rbx+0x28]
cmp gword ptr [rbp+0x10], 0
setne dl
@@ -230,51 +218,51 @@ G_M44929_IG23: ;; offset=0x025E
mov r8, gword ptr [rbp-0x10]
mov r9, gword ptr [rbp-0x18]
call [System.Runtime.CompilerServices.AsyncHelpers:FinishSuspensionNoContinuationContext(byref,bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
- ;; size=54 bbWeight=0 PerfScore 0.00-G_M44929_IG24: ;; offset=0x0294+ ;; size=29 bbWeight=0 PerfScore 0.00+G_M44929_IG26: ;; offset=0x024A
mov rcx, rbx
;; size=3 bbWeight=0 PerfScore 0.00
-G_M44929_IG25: ;; offset=0x0297+G_M44929_IG27: ;; offset=0x024D
add rsp, 72
pop rbx
pop rbp
ret ;; size=7 bbWeight=0 PerfScore 0.00
-G_M44929_IG26: ;; offset=0x029E+G_M44929_IG28: ;; offset=0x0254
mov rcx, gword ptr [rbp+0x10]
mov eax, dword ptr [rcx+0x1C]
cmp eax, 3
- ja SHORT G_M44929_IG27+ ja SHORT G_M44929_IG29
lea rdx, [reloc @RWD64]
mov edx, dword ptr [rdx+4*rax]
lea r8, G_M44929_IG02
add rdx, r8
jmp rdx
;; size=34 bbWeight=0 PerfScore 0.00
-G_M44929_IG27: ;; offset=0x02C0+G_M44929_IG29: ;; offset=0x0276
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG05
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG28: ;; offset=0x02CF+G_M44929_IG30: ;; offset=0x0285
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG06
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG29: ;; offset=0x02DE+G_M44929_IG31: ;; offset=0x0294
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG07
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG30: ;; offset=0x02ED+G_M44929_IG32: ;; offset=0x02A3
mov rcx, gword ptr [rcx+0x28]
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreExecutionContext(System.Threading.ExecutionContext)]
jmp G_M44929_IG08
;; size=15 bbWeight=0 PerfScore 0.00
-G_M44929_IG31: ;; offset=0x02FC+G_M44929_IG33: ;; offset=0x02B2
sub rsp, 56
;; size=4 bbWeight=0 PerfScore 0.00
-G_M44929_IG32: ;; offset=0x0300+G_M44929_IG34: ;; offset=0x02B6
cmp gword ptr [rbp+0x10], 0
setne cl
movzx rcx, cl
@@ -283,7 +271,7 @@ G_M44929_IG32: ;; offset=0x0300
call [System.Runtime.CompilerServices.AsyncHelpers:RestoreContexts(bool,System.Threading.ExecutionContext,System.Threading.SynchronizationContext)]
nop ;; size=26 bbWeight=0 PerfScore 0.00
-G_M44929_IG33: ;; offset=0x031A+G_M44929_IG35: ;; offset=0x02D0
add rsp, 56
ret ;; size=5 bbWeight=0 PerfScore 0.00
@@ -295,12 +283,12 @@ RWD32 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG18
RWD48 dq	(dynamicClass):IL_STUB_AsyncResume(System.Object,byref):System.Object
dq	G_M44929_IG21
-RWD64 dd	000002A7h ; case G_M44929_IG27- dd	000002B6h ; case G_M44929_IG28- dd	000002C5h ; case G_M44929_IG29- dd	000002D4h ; case G_M44929_IG30+RWD64 dd	0000025Dh ; case G_M44929_IG29+ dd	0000026Ch ; case G_M44929_IG30+ dd	0000027Bh ; case G_M44929_IG31+ dd	0000028Ah ; case G_M44929_IG32-; Total bytes of code 799, prolog size 25, PerfScore 51.00, instruction count 191, allocated bytes for code 799 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)+; Total bytes of code 725, prolog size 25, PerfScore 51.00, instruction count 175, allocated bytes for code 725 (MethodHash=967d507e) for method AsyncMicro.Program:Foo() (Tier1)
; ============================================================
NativeAOT Test size diffs
BaseSizeDiffSizeDeltaPercentName
16,573,44016,499,712-73,728-0.445%System.Linq.AsyncEnumerable.Tests.exe
31,153,66431,025,152-128,512-0.413%System.Net.Http.Functional.Tests.exe
115,722,240115,256,320-465,920-0.403%System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
19,599,87219,547,136-52,736-0.269%System.IO.Compression.Tests.exe
20,982,78420,930,560-52,224-0.249%System.Net.Quic.Functional.Tests.exe
20,066,30420,021,248-45,056-0.225%System.Formats.Tar.Tests.exe
10,061,82410,043,392-18,432-0.183%System.IO.Compression.ZipFile.Tests.exe
16,796,67216,766,976-29,696-0.177%System.Xml.Linq.Misc.Tests.exe
14,916,09614,889,984-26,112-0.175%System.Xml.Linq.Streaming.Tests.exe
16,529,92016,503,808-26,112-0.158%System.Xml.Linq.Events.Tests.exe
17,079,29617,052,672-26,624-0.156%System.Xml.Linq.xNodeBuilder.Tests.exe
17,022,46416,996,352-26,112-0.153%System.Xml.Linq.xNodeReader.Tests.exe
16,685,56816,659,968-25,600-0.153%System.Xml.Linq.Properties.Tests.exe
17,138,17617,112,576-25,600-0.149%System.Xml.Linq.TreeManipulation.Tests.exe
10,663,42410,648,576-14,848-0.139%System.IO.Pipelines.Tests.exe
22,751,23222,721,024-30,208-0.133%System.Net.Sockets.Tests.exe
20,016,12819,991,040-25,088-0.125%System.Net.WebSockets.Client.Tests.exe
28,812,80028,776,960-35,840-0.124%System.Net.Http.WinHttpHandler.Functional.Tests.exe
20,276,73620,254,208-22,528-0.111%System.Threading.Tasks.Dataflow.Tests.exe
19,061,24819,040,768-20,480-0.107%System.Net.HttpListener.Tests.exe
17,734,14417,716,224-17,920-0.101%System.Threading.Tasks.Extensions.Tests.exe
13,243,90413,231,104-12,800-0.097%System.IO.Packaging.Tests.exe
33,183,74433,152,000-31,744-0.096%System.Private.Xml.Tests.exe
21,716,48021,696,512-19,968-0.092%System.IO.FileSystem.Tests.exe
11,991,04011,980,288-10,752-0.090%System.IO.Tests.exe
10,275,84010,266,624-9,216-0.090%System.Threading.Channels.Tests.exe
13,869,05613,856,768-12,288-0.089%Microsoft.Extensions.Configuration.Functional.Tests.exe
14,570,49614,557,696-12,800-0.088%System.Net.WebClient.Tests.exe
12,415,48812,404,736-10,752-0.087%System.Xml.Linq.SDMSample.Tests.exe
17,569,28017,554,432-14,848-0.085%MetricOuterLoop.Tests.exe
12,848,12812,837,376-10,752-0.084%System.Xml.Schema.Extensions.Tests.exe
17,573,88817,560,064-13,824-0.079%MetricOuterLoop1.Tests.exe
27,902,97627,880,960-22,016-0.079%System.Net.Security.Tests.exe
17,792,51217,778,688-13,824-0.078%System.Formats.Tar.Manual.Tests.exe
15,759,87215,747,584-12,288-0.078%System.Windows.Extensions.Tests.exe
13,941,24813,930,496-10,752-0.077%Microsoft.Extensions.Configuration.Xml.Tests.exe
19,547,13619,532,288-14,848-0.076%System.Diagnostics.Process.Tests.exe
10,051,07210,043,392-7,680-0.076%System.Net.ServerSentEvents.Tests.exe
14,128,64014,117,888-10,752-0.076%System.DirectoryServices.Protocols.Tests.exe
15,100,41615,089,152-11,264-0.075%System.Drawing.Primitives.Tests.exe
18,449,92018,436,096-13,824-0.075%System.Threading.Tasks.Parallel.Tests.exe
21,093,37621,077,504-15,872-0.075%System.Net.Requests.Tests.exe
9,726,4649,719,296-7,168-0.074%System.Threading.RateLimiting.Tests.exe
19,291,64819,277,312-14,336-0.074%System.IO.Pipes.Tests.exe
17,432,06417,419,264-12,800-0.073%System.Net.Ping.Functional.Tests.exe
17,329,66417,317,376-12,288-0.071%System.Threading.Timer.Tests.exe
17,288,70417,276,416-12,288-0.071%System.Runtime.InteropServices.RuntimeInformation.Tests.exe
18,775,04018,761,728-13,312-0.071%Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,361,40817,349,120-12,288-0.071%System.Diagnostics.StackTrace.Tests.exe
17,214,97617,202,688-12,288-0.071%System.Net.ServicePoint.Tests.exe
15,078,40015,067,648-10,752-0.071%System.Security.Cryptography.Cng.Tests.exe
20,542,46420,528,128-14,336-0.070%System.Threading.Tasks.Tests.exe
18,381,82418,369,024-12,800-0.070%Microsoft.Extensions.Primitives.Tests.exe
18,492,92818,480,128-12,800-0.069%Microsoft.Extensions.Configuration.Tests.exe
18,455,04018,442,240-12,800-0.069%Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
17,154,04817,142,272-11,776-0.069%IcuAppLocal.Tests.exe
15,036,92815,026,688-10,240-0.068%System.Data.DataSetExtensions.Tests.exe
18,063,36018,051,072-12,288-0.068%System.Console.Tests.exe
17,430,52817,418,752-11,776-0.068%System.Diagnostics.TraceSource.Tests.exe
17,311,74417,299,968-11,776-0.068%System.Security.Principal.Windows.Tests.exe
11,270,14411,262,464-7,680-0.068%System.IO.Compression.Brotli.Tests.exe
17,967,10417,954,816-12,288-0.068%System.Threading.ThreadPool.Tests.exe
17,235,45617,223,680-11,776-0.068%System.Runtime.InvariantTimezone.Tests.exe
17,230,33617,218,560-11,776-0.068%System.ComponentModel.EventBasedAsync.Tests.exe
11,327,48811,319,808-7,680-0.068%System.Net.WebSockets.Tests.exe
17,298,43217,286,656-11,776-0.068%System.Security.Claims.Tests.exe
17,616,38417,604,608-11,776-0.067%System.Threading.Thread.Tests.exe
17,660,92817,649,152-11,776-0.067%System.IO.FileSystem.Watcher.Tests.exe
17,657,34417,645,568-11,776-0.067%System.Buffers.Tests.exe
16,105,98416,095,232-10,752-0.067%System.Data.Odbc.Tests.exe
18,357,24818,344,960-12,288-0.067%Microsoft.Extensions.FileProviders.Composite.Tests.exe
19,870,72019,857,408-13,312-0.067%System.Text.Encoding.Tests.exe
17,160,19217,148,928-11,264-0.066%System.Runtime.Serialization.Formatters.Disabled.Tests.exe
17,967,10417,955,328-11,776-0.066%System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
9,329,1529,323,008-6,144-0.066%Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
9,246,2089,240,064-6,144-0.066%Microsoft.Bcl.AsyncInterfaces.Tests.exe
19,680,25619,667,456-12,800-0.065%System.Net.Http.Unit.Tests.exe
18,032,12818,020,352-11,776-0.065%Microsoft.Extensions.Diagnostics.Tests.exe
17,281,53617,270,272-11,264-0.065%System.Threading.Overlapped.Tests.exe
18,128,38418,116,608-11,776-0.065%System.Diagnostics.TextWriterTraceListener.Tests.exe
18,177,02418,165,248-11,776-0.065%System.Text.Encoding.CodePages.Tests.exe
19,744,25619,731,456-12,800-0.065%System.Resources.ResourceManager.Tests.exe
17,355,77617,344,512-11,264-0.065%Microsoft.Win32.SystemEvents.Tests.exe
18,371,07218,359,296-11,776-0.064%System.Threading.Tests.exe
19,080,19219,067,904-12,288-0.064%Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
27,164,67227,147,264-17,408-0.064%Microsoft.Extensions.Hosting.Unit.Tests.exe
18,693,12018,681,344-11,776-0.063%Microsoft.Extensions.Logging.Console.Tests.exe
19,972,60819,960,320-12,288-0.062%Microsoft.Extensions.Logging.Tests.exe
18,488,32018,477,056-11,264-0.061%Microsoft.Extensions.Hosting.Systemd.Tests.exe
18,517,50418,506,240-11,264-0.061%System.IO.MemoryMappedFiles.Tests.exe
19,294,72019,282,944-11,776-0.061%System.Net.Primitives.Functional.Tests.exe
18,585,60018,574,336-11,264-0.061%ComInterfaceGenerator.Tests.exe
18,833,40818,822,144-11,264-0.060%System.Runtime.Caching.Tests.exe
9,435,6489,430,016-5,632-0.060%Microsoft.Extensions.Logging.Testing.Tests.exe
24,286,20824,271,872-14,336-0.059%Microsoft.Extensions.Http.Tests.exe
20,453,37620,441,600-11,776-0.058%System.Reflection.Tests.exe
9,653,2489,647,616-5,632-0.058%Microsoft.Extensions.Hosting.Functional.Tests.exe
19,484,16019,472,896-11,264-0.058%Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
20,233,72820,221,952-11,776-0.058%System.Runtime.InteropServices.Tests.exe
19,555,32819,544,064-11,264-0.058%Microsoft.Extensions.Configuration.Json.Tests.exe
20,475,39220,463,616-11,776-0.058%System.Diagnostics.DiagnosticSource.Tests.exe
10,100,22410,094,592-5,632-0.056%Microsoft.Extensions.Caching.Memory.Tests.exe
25,892,86425,878,528-14,336-0.055%System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
20,740,09620,728,832-11,264-0.054%System.Collections.Concurrent.Tests.exe
10,504,19210,498,560-5,632-0.054%Microsoft.Extensions.Options.Tests.exe
20,804,09620,792,832-11,264-0.054%System.Security.Cryptography.Csp.Tests.exe
20,531,20020,520,448-10,752-0.052%System.Runtime.Extensions.Tests.exe
21,621,24821,609,984-11,264-0.052%System.Data.OleDb.Tests.exe
21,071,87221,061,120-10,752-0.051%Microsoft.Extensions.Logging.EventSource.Tests.exe
23,403,52023,391,744-11,776-0.050%System.Memory.Tests.exe
26,441,72826,428,416-13,312-0.050%System.ComponentModel.TypeConverter.Tests.exe
11,580,92811,575,296-5,632-0.049%System.Net.Http.Json.Unit.Tests.exe
29,404,67229,390,848-13,824-0.047%Microsoft.Extensions.DependencyModel.Tests.exe
2,233,3442,234,368+1,024+0.046%clrjit.dll
26,095,10426,083,328-11,776-0.045%System.Globalization.Tests.exe
26,005,50425,994,240-11,264-0.043%System.Globalization.Nls.Tests.exe
45,488,64045,472,768-15,872-0.035%System.Security.Cryptography.Tests.exe
33,384,96033,373,184-11,776-0.035%Microsoft.Bcl.Cryptography.Tests.exe
32,736,76832,725,504-11,264-0.034%System.Linq.Expressions.Tests.exe
44,701,69644,687,360-14,336-0.032%System.Runtime.Tests.exe
16,977,92016,973,824-4,096-0.024%System.Private.CoreLib.dll
8,964,6088,963,072-1,536-0.017%System.Net.Primitives.Pal.Tests.exe
9,560,5769,559,040-1,536-0.016%System.Memory.Data.Tests.exe
12,174,33612,172,800-1,536-0.013%System.Net.NetworkInformation.Functional.Tests.exe
8,598,5288,597,504-1,024-0.012%System.Composition.Runtime.Tests.exe
8,598,0168,596,992-1,024-0.012%System.Xml.Linq.Axes.Tests.exe
8,753,1528,752,128-1,024-0.012%Microsoft.Bcl.TimeProvider.Tests.exe
8,674,3048,673,280-1,024-0.012%System.IO.FileSystem.Manual.Tests.exe
8,904,1928,903,168-1,024-0.012%System.IO.Pipes.AccessControl.Tests.exe
9,678,8489,677,824-1,024-0.011%System.Text.RegularExpressions.Unit.Tests.exe
9,325,5689,324,544-1,024-0.011%System.IO.IsolatedStorage.Tests.exe
9,117,1849,116,160-1,024-0.011%System.Security.AccessControl.Tests.exe
9,057,7929,056,768-1,024-0.011%System.ValueTuple.Tests.exe
9,620,9929,619,968-1,024-0.011%System.Private.Uri.Functional.Tests.exe
10,483,71210,482,688-1,024-0.010%System.Net.Http.WinHttpHandler.Unit.Tests.exe
10,037,24810,036,224-1,024-0.010%System.Diagnostics.Debug.Tests.exe
9,775,1049,774,080-1,024-0.010%System.Net.WebProxy.Tests.exe
11,457,53611,456,512-1,024-0.009%System.IO.Ports.Tests.exe
11,767,80811,766,784-1,024-0.009%System.Security.Cryptography.Cose.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Nls.Tests.exe
15,374,33615,373,312-1,024-0.007%System.Globalization.Extensions.Tests.exe
8,627,2008,626,688-512-0.006%System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,693,7608,693,248-512-0.006%System.Private.Uri.Unit.Tests.exe
8,926,7208,926,208-512-0.006%Microsoft.Bcl.Memory.Tests.exe
8,522,2408,521,728-512-0.006%System.ComponentModel.Tests.exe
8,566,2728,565,760-512-0.006%Microsoft.Bcl.Numerics.Tests.exe
9,013,7609,013,248-512-0.006%Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,838,1448,837,632-512-0.006%System.Reflection.Extensions.Tests.exe
8,654,8488,654,336-512-0.006%System.Runtime.CompilerServices.Unsafe.Tests.exe
8,743,9368,743,424-512-0.006%System.IO.FileSystem.DriveInfo.Tests.exe
9,083,3929,082,880-512-0.006%System.IO.FileSystem.AccessControl.Tests.exe
8,999,9368,999,424-512-0.006%System.Reflection.TypeExtensions.Tests.exe
8,660,9928,661,504+512+0.006%System.Runtime.InteropServices.ComDisabled.Tests.exe
9,030,6569,030,144-512-0.006%Microsoft.Extensions.Configuration.CommandLine.Tests.exe
8,809,9848,809,472-512-0.006%System.Console.Manual.Tests.exe
9,189,8889,189,376-512-0.006%System.ServiceProcess.ServiceController.Tests.exe
8,965,6328,965,120-512-0.006%Microsoft.Win32.Registry.Tests.exe
8,674,8168,674,304-512-0.006%System.Security.Cryptography.ProtectedData.Tests.exe
9,180,6729,180,160-512-0.006%Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
8,644,0968,643,584-512-0.006%System.Runtime.Handles.Tests.exe
8,791,5528,791,040-512-0.006%System.Web.HttpUtility.Tests.exe
9,339,3929,338,880-512-0.005%System.Reflection.Context.Tests.exe
10,924,54410,924,032-512-0.005%System.Runtime.Intrinsics.Tests.exe
10,573,31210,572,800-512-0.005%Common.Tests.exe
9,922,5609,922,048-512-0.005%System.Collections.NonGeneric.Tests.exe
11,167,23211,166,720-512-0.005%System.Text.Encodings.Web.Tests.exe
9,600,5129,600,000-512-0.005%System.Diagnostics.EventLog.Tests.exe
11,022,84811,022,336-512-0.005%System.Runtime.Numerics.Tests.exe
9,605,1209,604,608-512-0.005%System.Composition.Convention.Tests.exe
9,350,6569,350,144-512-0.005%System.Net.Mail.Unit.Tests.exe
9,649,1529,648,640-512-0.005%System.IO.UnmanagedMemoryStream.Tests.exe
11,351,04011,350,528-512-0.005%System.Net.Security.Unit.Tests.exe
9,462,7849,462,272-512-0.005%Microsoft.Extensions.Configuration.Ini.Tests.exe
9,335,2969,334,784-512-0.005%System.Security.Permissions.Tests.exe
9,936,3849,935,872-512-0.005%LibraryImportGenerator.Tests.exe
12,259,84012,259,328-512-0.004%System.Reflection.Metadata.Tests.exe
15,199,74415,199,232-512-0.003%System.Linq.Tests.exe
22,308,35222,307,840-512-0.002%System.Security.Cryptography.Pkcs.Tests.exe
8,677,3768,677,37600.000%System.Security.SecureString.Tests.exe
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
8,531,9688,531,96800.000%System.Text.Encoding.Extensions.Tests.exe
8,977,4088,977,40800.000%System.Runtime.Serialization.Primitives.Tests.exe
7,318,0167,318,01600.000%XUnitLogChecker.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
84,48084,48000.000%System.Globalization.Native.dll
108,032108,03200.000%CMakeCXXCompilerId.exe
108,032108,03200.000%CMakeCCompilerId.exe
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
8,932,8648,932,86400.000%System.Threading.AccessControl.Tests.exe
536,096536,09600.000%msquic.dll
8,517,1208,517,12000.000%System.IO.FileSystem.Primitives.Tests.exe
8,580,0968,580,09600.000%System.Resources.Writer.Tests.exe
1,502,7201,502,72000.000%mscordaccore.dll
1,502,7201,502,72000.000%mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984361,98400.000%hostpolicy.dll
350,208350,20800.000%hostfxr.dll
62,46462,46400.000%createdump.exe
210,944210,94400.000%corerun.exe
4,956,1604,956,16000.000%coreclr.dll
722,944722,94400.000%clrgcexp.dll
678,400678,40000.000%clrgc.dll
307,200307,20000.000%clretwrc.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,575,4888,575,48800.000%Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,731,6488,731,64800.000%Invariant.Tests.exe
15,922,17615,922,17600.000%ilc.exe
7,703,0407,703,04000.000%ilasm.exe
13,418,49613,418,49600.000%crossgen2.exe
9,956,3529,956,35200.000%llvm-mca.exe
696,320696,32000.000%FileCheck.exe
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
84,48084,48000.000%System.Globalization.Native.dll
1,309,1841,309,18400.000%mscordbi.dll
8,520,7048,520,70400.000%System.Runtime.CompilerServices.VisualC.Tests.exe
536,096536,09600.000%msquic.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
8,784,8968,784,89600.000%System.Resources.Reader.Tests.exe
11,577,85611,577,85600.000%System.Resources.Extensions.Tests.exe
18,752,00018,752,00000.000%System.Numerics.Vectors.Tests.exe
8,614,9128,614,91200.000%System.Net.WebHeaderCollection.Tests.exe
9,288,7049,288,70400.000%System.Net.Primitives.UnitTests.Tests.exe
9,014,7849,014,78400.000%System.Net.NameResolution.Pal.Tests.exe
9,512,4489,512,44800.000%System.IO.Hashing.Tests.exe
696,320696,32000.000%FileCheck.exe
9,139,2009,139,20000.000%System.Globalization.Calendars.Tests.exe
9,825,7929,825,79200.000%System.Formats.Nrbf.Tests.exe
9,736,7049,736,70400.000%System.Formats.Asn1.Tests.exe
8,522,2408,522,24000.000%System.Diagnostics.Tools.Tests.exe
8,691,2008,691,20000.000%System.Diagnostics.FileVersionInfo.Tests.exe
8,536,5768,536,57600.000%System.Diagnostics.Contracts.Tests.exe
8,532,4808,532,48000.000%System.Composition.AttributeModel.Tests.exe
9,135,6169,135,61600.000%System.ComponentModel.Primitives.Tests.exe
17,812,48017,812,48000.000%System.Collections.Tests.exe
9,722,8809,722,88000.000%System.Collections.Specialized.Tests.exe
8,620,5448,620,54400.000%Microsoft.Win32.Registry.AccessControl.Tests.exe
8,637,4408,637,44000.000%Microsoft.Win32.Primitives.Tests.exe
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,309,1522,309,15200.000%Microsoft.DiaSymReader.Native.amd64.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,935,2961,935,29600.000%Microsoft.DiaSymReader.Native.x86.dll
2,247,7842,247,78400.000%Microsoft.DiaSymReader.Native.arm64.dll
1,754,5121,754,51200.000%Microsoft.DiaSymReader.Native.arm.dll
1,377,2801,377,28000.000%System.IO.Compression.Native.dll
9,956,3529,956,35200.000%llvm-mca.exe

CopilotAI review requested due to automatic review settings March 31, 2026 16:24
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR async-await JIT transformation to further reduce generated code size by fully sharing the “finish suspension” tail logic (context capture/restore + return-suspend) across multiple awaits via shared blocks, leveraging the helper-based suspension helpers added previously.

Changes:

  • Adds two new AsyncHelpers “finish suspension” helpers to the JIT/EE async interface (CORINFO_ASYNC_INFO) and wires them through VM, SuperPMI, and JIT interface tooling.
  • Updates the JIT async transformation to optionally route multiple suspension epilogs through shared “finish context handling” blocks (separately for with/without continuation-context capture).
  • Exposes ExecutionContext.InstanceIsFlowSuppressed to support the new helpers’ flow-suppressed handling logic.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.csAdds internal instance accessor for flow-suppressed state used by new suspension helpers.
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.csAdds FinishSuspension* helper implementations used by JIT-generated suspension tails.
src/coreclr/inc/corinfo.hExtends CORINFO_ASYNC_INFO with method handles for the new finish-suspension helpers.
src/coreclr/vm/corelib.hAdds CoreLib binder entries for the new AsyncHelpers methods.
src/coreclr/vm/jitinterface.cppPopulates the new helper method handles in CEEInfo::getAsyncInfo.
src/coreclr/jit/async.hAdds helper selection and accounting types + fields for shared finish-context-handling blocks.
src/coreclr/jit/async.cppImplements shared finish-suspension block creation and reroutes suspension epilogs to shared blocks when beneficial.
src/coreclr/jit/gentree.hAdds a hook for “needs execution context save/restore” used by the async transformation logic.
src/coreclr/inc/jiteeversionguid.hBumps JIT/EE version GUID to reflect the interface change.
src/coreclr/tools/superpmi/superpmi-shared/agnostic.hUpdates SuperPMI agnostic async info struct to include the new method handles.
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cppRecords/replays the new async helper handles for SuperPMI.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csUpdates managed projection of CORINFO_ASYNC_INFO.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csProvides the new helper method handles to the managed JIT interface implementation.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.csEnsures R2R compilation includes references to the new AsyncHelpers methods.
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.csAdds dependency scanning for the new AsyncHelpers methods.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/async.cpp Outdated
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/inc/jiteeversionguid.h Outdated
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from b8e698f to 8cba3d6CompareApril 28, 2026 10:28
CopilotAI review requested due to automatic review settings April 28, 2026 10:28
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 8cba3d6 to 6415139CompareApril 28, 2026 10:28
When multiple awaits have common context handling logic during
suspension we can share that logic completely by jumping to a common
block. This PR implements that size optimization.
@jakobbotsch
jakobbotschforce-pushed the fully-share-suspension-tails branch from 6415139 to dba203dCompareApril 28, 2026 10:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment threadsrc/coreclr/jit/gentree.h
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
Comment threadsrc/coreclr/jit/async.cpp
@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs. Looks like this ran while the collections were only partially completed, so some of the diffs are missing. But the NAOT diffs above are more telling anyway.

@jakobbotsch
jakobbotsch merged commit 6499da1 into dotnet:mainApr 29, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the fully-share-suspension-tails branch April 29, 2026 12:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jakobbotsch@EgorBo