Related to #1805.
If you have code such as:
Unsafe.SkipInit(out Vector128<short> value);
if (Sse.IsSupported)
{
value = Vector128.Create(value);
}
The linker will trim out the initialization but not the Unsafe.SkipInit(out Vector128<short> value); as it doesn't recognize the call today.
If you try to refactor this to something such as:
Vector128<short> value;
if (Sse.IsSupported)
{
value = Vector128.Create(value);
}
else
{
value = default;
}
The linker trims it down to just: Vector128<short> value = default; but does not remove the local and therefore does not remove the now unused Vector128<T> type even though the only usage of value is in an initobj valuetype [System.Private.CoreLib]System.Runtime.Intrinsics.Vector1281` instruction.
The linker should likely recognize this scenario and trim the unused local.