Order of initialization in async kickoff method with params blocks Jit zero init eliding #45295
Labels
Area-Compilers
Bug
Code Gen Quality
Room for improvement in the quality of the compiler's generated code
Milestone
Currently Rosyln zeros the the AsyncMethodBuilder field with
.locals init
and then assigns the result of.Create
to that field.When
.Create
is inlined it is also zeros; so the assignment is a second set of zeroing.The Jit has an optimization where it will remove the second set of zeroing dotnet/runtime#36918 ("Optimization to remove redundant zero initializations"); however this only kicks in if there aren't any preceding non-zero assignments.
e.g.
If the call to
.Create()
was moved to the first step; prior to saving parameters to the fields so it should not block the redundant zero elimination optimization.From dotnet/runtime#2325 (comment)
The text was updated successfully, but these errors were encountered: