Open
Description
We removed the span temp for now per #71195 (comment).
We'd like to reintroduce the span temp later, perhaps only when non-async, or when lowering can prove that the span will not be used across an await boundary, or perhaps even reinitializing the span temp when it is used across an await boundary.
This would result in a maybe 2% perf improvement for CopyTo codegen.
T[] result = [..arr1, ..arr2];
// currently becomes
((Span<T>)arr1).CopyTo((Span<T>)result).Slice(...));
((Span<T>)arr2).CopyTo((Span<T>)result).Slice(...));
// we could instead do:
Span<T> spanTemp = result;
((Span<T>)arr1).CopyTo(spanTemp.Slice(...));
((Span<T>)arr2).CopyTo(spanTemp.Slice(...));