JIT: optimize more array covariant store checks in the importer by AndyAyersMS · Pull Request #189 · dotnet/runtime (original) (raw)

Code size impact when optimizing (from dotnet/coreclr#6537).

Large regressions are all cases where loop cloning now kicks in, as this change makes more array accesses explicit in the JIT's IR, and that's what triggers cloning. Likely these are poor decisions by the cloner. Fixing that is a separate issue; see dotnet/coreclr#2634 and related.

Total bytes of diff: -27916 (-0.07% of base)
    diff is an improvement.

Top file regressions by size (bytes):
        1349 : System.Data.Common.dasm (0.09% of base)
         602 : System.Linq.Expressions.dasm (0.08% of base)
         201 : System.Collections.Specialized.dasm (0.79% of base)
         125 : System.Reflection.DispatchProxy.dasm (0.50% of base)
         106 : System.Collections.Concurrent.dasm (0.03% of base)

Top file improvements by size (bytes):
      -12978 : Microsoft.Diagnostics.Tracing.TraceEvent.dasm (-0.41% of base)
       -6458 : Microsoft.CodeAnalysis.VisualBasic.dasm (-0.12% of base)
       -3051 : Microsoft.CodeAnalysis.CSharp.dasm (-0.07% of base)
       -1570 : System.Private.Xml.dasm (-0.04% of base)
        -725 : System.Net.HttpListener.dasm (-0.32% of base)

99 total files with size differences (82 improved, 17 regressed), 30 unchanged.

Top method regressions by size (bytes):
         576 (26.10% of base) : System.Linq.Expressions.dasm - StackSpiller:RewriteListInitExpression(ref,int):struct:this
         444 (13.12% of base) : Microsoft.CodeAnalysis.CSharp.dasm - LocalRewriter:RewriteMultiDimensionalArrayForEachStatement(ref):ref:this
         322 ( 7.27% of base) : Microsoft.CodeAnalysis.CSharp.dasm - MethodBodySynthesizer:ConstructFieldLikeEventAccessorBody_Regular(ref,bool,ref,ref):ref
         322 (61.22% of base) : System.Private.CoreLib.dasm - MethodBase:CheckArguments(ref,ref,int,ref,ref):ref:this
         280 (17.41% of base) : System.Private.CoreLib.dasm - RuntimeType:MakeGenericType(ref):ref:this (2 methods)

Top method improvements by size (bytes):
       -1439 (-8.21% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Binder:ReportOverloadResolutionFailureForASingleCandidate(ref,ref,int,byref,struct,struct,bool,bool,bool,bool,ref,ref,bool,ref,ref):this
        -350 (-9.14% of base) : System.Private.CoreLib.dasm - CalendarData:CreateInvariant():ref (2 methods)
        -330 (-3.64% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - SyntaxFactory:GetNodeTypes():ref
        -305 (-0.95% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - VisualBasicCommandLineParser:Parse(ref,ref,ref,ref):ref:this
        -195 (-0.82% of base) : Microsoft.CodeAnalysis.CSharp.dasm - CSharpCommandLineParser:Parse(ref,ref,ref,ref):ref:this

Top method regressions by size (percentage):
         114 (83.82% of base) : System.Collections.Specialized.dasm - NameObjectCollectionBase:BaseGetAllKeys():ref:this
         114 (83.82% of base) : System.Collections.Specialized.dasm - NameObjectCollectionBase:BaseGetAllValues():ref:this
          75 (65.22% of base) : System.IO.FileSystem.DriveInfo.dasm - DriveInfo:GetDrives():ref
          90 (61.64% of base) : System.Data.Common.dasm - FieldNameLookup:.ctor(ref,int):this
         322 (61.22% of base) : System.Private.CoreLib.dasm - MethodBase:CheckArguments(ref,ref,int,ref,ref):ref:this

Top method improvements by size (percentage):
         -41 (-14.19% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - SynthesizedMyGroupCollectionPropertyGetAccessorSymbol:GetMethodBlock(ref,ref,ref):ref:this
         -41 (-14.19% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - SynthesizedMyGroupCollectionPropertySetAccessorSymbol:GetMethodBlock(ref,ref,ref):ref:this
         -37 (-13.17% of base) : System.Private.CoreLib.dasm - NativeRuntimeEventSource:MethodJitInliningSucceeded(ref,ref,ref,ref,ref,ref,ref,ref,ref,ushort):this
         -37 (-13.17% of base) : System.Private.CoreLib.dasm - NativeRuntimeEventSource:MethodJitInliningFailedAnsi(ref,ref,ref,ref,ref,ref,ref,ref,ref,bool):this
         -37 (-13.17% of base) : System.Private.CoreLib.dasm - NativeRuntimeEventSource:MethodJitTailCallFailedAnsi(ref,ref,ref,ref,ref,ref,ref,ref,ref,bool):this

4129 total methods with size differences (3799 improved, 330 regressed), 199577 unchanged

Will update with Tier0 code size impact when I have it.