You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do we still need [AggressiveOptimization] on so many methods? #71261
dotnet/coreclr#22191 added a bunch of [AggressiveOptimization] attributes to methods throughout SpanHelpers and elsewhere that make heavy use of intrinsics, e.g.
I think we can remove them at least from SpanHelpers because SPC.dll is always prejitted (R2R) so e.g. SpanHelpers will never see Tier0 and will be properly instrumented and optimized for current app (in Dynamic PGO mode), e.g. if current app mostly works with large inputs we will re-order "handle small-inputs" blocks, etc.
However, we might need to check that SpanHelpers is actually fully prejitted due to presence of Vector<T> (see #67398 (comment))
SpanHelpers members which refuse to precompile (because they use Vector<T> without Vector128 and Vector256 paths)
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<__Canon>(__Canon&,native uint,__Canon)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.UnalignedCountVector(char&)` was not compiled because `This function is using SIMD intrinsics, their size is machine specific` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.GetCharVectorSpanLength(native int,native int)` was not compiled because `This function is using SIMD intrinsics, their size is machine specific` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.UnalignedCountVectorFromEnd(uint8&,int32)` was not compiled because `This function is using SIMD intrinsics, their size is machine specific` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.UnalignedCountVector(uint8&)` was not compiled because `This function is using SIMD intrinsics, their size is machine specific` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.GetByteVectorSpanLength(native uint,int32)` was not compiled because `This function is using SIMD intrinsics, their size is machine specific` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.LastIndexOfAny(uint8&,uint8,uint8,uint8,int32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.LastIndexOfAny(uint8&,uint8,uint8,int32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<char>(char&,native uint,char)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<GuidResult>(GuidResult&,native uint,GuidResult)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<native int>(native int&,native uint,native int)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<int32>(int32&,native uint,int32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<float32>(float32&,native uint,float32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<uint16>(uint16&,native uint,uint16)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<uint64>(uint64&,native uint,uint64)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<uint32>(uint32&,native uint,uint32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<int64>(int64&,native uint,int64)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<int16>(int16&,native uint,int16)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.IndexOfValueType<int32>(int32&,int32,int32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<int32>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.IndexOfValueType<int64>(int64&,int64,int32)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<int64>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<KeyValuePair`2<__Canon,__Canon>>(KeyValuePair`2<__Canon,__Canon>&,native uint,KeyValuePair`2<__Canon,__Canon>)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<CalendarId>(CalendarId&,native uint,CalendarId)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<float64>(float64&,native uint,float64)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<KeyValuePair`2<SessionInfo,bool>>(KeyValuePair`2<SessionInfo,bool>&,native uint,KeyValuePair`2<SessionInfo,bool>)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<KeyValuePair`2<int32,__Canon>>(KeyValuePair`2<int32,__Canon>&,native uint,KeyValuePair`2<int32,__Canon>)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
Info: Method `[S.P.CoreLib]System.SpanHelpers.Fill<SessionInfo>(SessionInfo&,native uint,SessionInfo)` was not compiled because `[S.P.CoreLib]System.Numerics.Vector`1<uint8>` requires runtime JIT
I assume we can close this one as we now have only 3 [AO] in BCL:
AsyncTaskMethodBuilder<TResult>.AwaitUnsafeOnCompleted the comment states that it allocates in T0 (presumably, when R2R doesn't hande a specific generic instance)
(and 3) CastHelper's StelemRef and LdelemaRef -- these have to be [AO] because VM special case them to be direct calls (so there is no call counting in between) - we can make them indirect just like 99% of other methods but VSadov claimed it is needed for perf.
Activity
jkotas commentedon Jun 24, 2022
These [AggressiveOptimization] attributes were added as a workaround for #9120
EgorBo commentedon Jun 26, 2022
I think we can remove them at least from
SpanHelpersbecause SPC.dll is always prejitted (R2R) so e.g.SpanHelperswill never see Tier0 and will be properly instrumented and optimized for current app (in Dynamic PGO mode), e.g. if current app mostly works with large inputs we will re-order "handle small-inputs" blocks, etc.However, we might need to check that
SpanHelpersis actually fully prejitted due to presence ofVector<T>(see #67398 (comment))EgorBo commentedon Jun 26, 2022
SpanHelpers members which refuse to precompile (because they use
Vector<T>withoutVector128andVector256paths)EgorBo commentedon Jul 6, 2022
Moving to 8.0.0 as it depends on the planned change to make crossgen avx2-aware by default.
EgorBo commentedon May 6, 2023
I assume we can close this one as we now have only 3 [AO] in BCL:
AsyncTaskMethodBuilder<TResult>.AwaitUnsafeOnCompletedthe comment states that it allocates in T0 (presumably, when R2R doesn't hande a specific generic instance)StelemRefandLdelemaRef-- these have to be [AO] because VM special case them to be direct calls (so there is no call counting in between) - we can make them indirect just like 99% of other methods but VSadov claimed it is needed for perf.