Collection expression span optimization should reuse temps when possible #73269
Labels
Area-Compilers
Bug
Code Gen Quality
Room for improvement in the quality of the compiler's generated code
New Feature - ParamsCollections
Milestone
Currently it looks like a new temp slot is allocated in IL for each collection expression which uses the InlineArray or ref to single temp lowering strategy. We should figure out how to reuse these temps where possible.
See the following test for reference. Note that separate temps are introduced for both
y
andz
. It should be fairly straightforward to reuse temps in disjunct blocks, but some analysis should enable reuse within the same block as well.Originally posted by @jaredpar in #73086 (comment)
The text was updated successfully, but these errors were encountered: