Skip to content

Conversation

@BruceForstall
Copy link
Contributor

Add an option, statically determined at compile time,
to generate loop cloning loop choice conditions into one block
per condition instead of using bitwise and operators to always
execute all non-dependent conditions in a single block.

This leads to code size reduction in the condition code, as well
as making it easier to understand.

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 2, 2021
@ghost
Copy link

ghost commented Oct 2, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Add an option, statically determined at compile time,
to generate loop cloning loop choice conditions into one block
per condition instead of using bitwise and operators to always
execute all non-dependent conditions in a single block.

This leads to code size reduction in the condition code, as well
as making it easier to understand.

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Contributor Author

This is a revival of #55863

@BruceForstall
Copy link
Contributor Author

The asm diffs are very good:

aspnet.run.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 16436
Total bytes of diff: 15978
Total bytes of delta: -458 (-2.79% of base)
Total relative delta: -1.38
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           1 : 33404.dasm (0.06% of base)

Top file improvements (bytes):
         -16 : 27235.dasm (-5.14% of base)
         -16 : 43712.dasm (-7.24% of base)
         -16 : 38488.dasm (-7.24% of base)
         -14 : 28125.dasm (-5.65% of base)
         -14 : 35076.dasm (-4.35% of base)
         -14 : 33214.dasm (-5.71% of base)
         -14 : 38669.dasm (-5.65% of base)
         -14 : 40145.dasm (-5.71% of base)
         -12 : 41405.dasm (-2.96% of base)
         -12 : 35380.dasm (-2.96% of base)
         -11 : 31183.dasm (-2.01% of base)
         -11 : 40029.dasm (-2.96% of base)
         -11 : 29203.dasm (-2.98% of base)
         -11 : 35266.dasm (-1.90% of base)
         -11 : 39341.dasm (-2.96% of base)
         -11 : 43957.dasm (-2.87% of base)
         -11 : 29526.dasm (-1.34% of base)
         -11 : 41305.dasm (-1.90% of base)
         -11 : 28192.dasm (-2.93% of base)
         -11 : 38652.dasm (-5.00% of base)

40 total files with Code Size differences (39 improved, 1 regressed), 0 unchanged.

Top method regressions (bytes):
           1 ( 0.06% of base) : 33404.dasm - DefaultTypeMap:FindConstructor(ref,ref):ConstructorInfo:this

Top method improvements (bytes):
         -16 (-5.14% of base) : 27235.dasm - ObjectEqualityComparer`1:IndexOf(ref,__Canon,int,int):int:this
         -16 (-7.24% of base) : 43712.dasm - ObjectEqualityComparer`1:IndexOf(ref,__Canon,int,int):int:this
         -16 (-7.24% of base) : 38488.dasm - ObjectEqualityComparer`1:IndexOf(ref,__Canon,int,int):int:this
         -14 (-5.65% of base) : 28125.dasm - ValueCollection:CopyTo(ref,int):this
         -14 (-4.35% of base) : 35076.dasm - ControllerActionInvoker:PrepareArguments(IDictionary`2,ObjectMethodExecutor):ref
         -14 (-5.71% of base) : 33214.dasm - ValueCollection:CopyTo(ref,int):this
         -14 (-5.65% of base) : 38669.dasm - ValueCollection:CopyTo(ref,int):this
         -14 (-5.71% of base) : 40145.dasm - ValueCollection:CopyTo(ref,int):this
         -12 (-2.96% of base) : 41405.dasm - Dictionary`2:CopyTo(ref,int):this
         -12 (-2.96% of base) : 35380.dasm - Dictionary`2:CopyTo(ref,int):this
         -11 (-2.01% of base) : 31183.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-2.96% of base) : 40029.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-2.98% of base) : 29203.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-1.90% of base) : 35266.dasm - Dictionary`2:AddRange(IEnumerable`1):this
         -11 (-2.96% of base) : 39341.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this
         -11 (-2.87% of base) : 43957.dasm - PoolManager:TryGetValue(String,byref):bool
         -11 (-1.34% of base) : 29526.dasm - NormalizedRouteValue:GetNormalizedRouteValue(ActionContext,String):String
         -11 (-1.90% of base) : 41305.dasm - Dictionary`2:AddRange(IEnumerable`1):this
         -11 (-2.93% of base) : 28192.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-5.00% of base) : 38652.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this

Top method regressions (percentages):
           1 ( 0.06% of base) : 33404.dasm - DefaultTypeMap:FindConstructor(ref,ref):ConstructorInfo:this

Top method improvements (percentages):
         -16 (-7.24% of base) : 43712.dasm - ObjectEqualityComparer`1:IndexOf(ref,__Canon,int,int):int:this
         -16 (-7.24% of base) : 38488.dasm - ObjectEqualityComparer`1:IndexOf(ref,__Canon,int,int):int:this
         -14 (-5.71% of base) : 33214.dasm - ValueCollection:CopyTo(ref,int):this
         -14 (-5.71% of base) : 40145.dasm - ValueCollection:CopyTo(ref,int):this
         -14 (-5.65% of base) : 28125.dasm - ValueCollection:CopyTo(ref,int):this
         -14 (-5.65% of base) : 38669.dasm - ValueCollection:CopyTo(ref,int):this
         -16 (-5.14% of base) : 27235.dasm - ObjectEqualityComparer`1:IndexOf(ref,__Canon,int,int):int:this
         -11 (-5.00% of base) : 38652.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this
         -11 (-5.00% of base) : 28095.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this
         -11 (-4.80% of base) : 29528.dasm - RouteValueDictionary:TryFindItem(String,byref):bool:this
         -14 (-4.35% of base) : 35076.dasm - ControllerActionInvoker:PrepareArguments(IDictionary`2,ObjectMethodExecutor):ref
         -11 (-4.03% of base) : 38956.dasm - RouteValueDictionary:TryGetValue(String,byref):bool:this
         -11 (-4.03% of base) : 29527.dasm - RouteValueDictionary:TryGetValue(String,byref):bool:this
         -11 (-3.69% of base) : 41430.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this
         -11 (-3.69% of base) : 35414.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this
         -11 (-2.98% of base) : 29203.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-2.96% of base) : 40029.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-2.96% of base) : 39341.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this
         -11 (-2.96% of base) : 33016.dasm - Dictionary`2:Resize(int,bool):this
         -11 (-2.96% of base) : 34937.dasm - EnumerableSorter`2:ComputeKeys(ref,int):this

40 total methods with Code Size differences (39 improved, 1 regressed), 0 unchanged.


benchmarks.run.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 94909
Total bytes of diff: 91600
Total bytes of delta: -3309 (-3.49% of base)
Total relative delta: -5.64
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          56 : 12950.dasm (3.20% of base)
           9 : 18653.dasm (0.62% of base)
           7 : 12449.dasm (0.67% of base)
           6 : 2623.dasm (0.30% of base)
           2 : 1559.dasm (0.06% of base)

Top file improvements (bytes):
        -516 : 25273.dasm (-13.35% of base)
        -430 : 15682.dasm (-12.65% of base)
        -116 : 1451.dasm (-1.06% of base)
        -112 : 15681.dasm (-9.80% of base)
         -97 : 15680.dasm (-8.47% of base)
         -92 : 11806.dasm (-9.05% of base)
         -75 : 8012.dasm (-6.91% of base)
         -72 : 15683.dasm (-9.17% of base)
         -66 : 3969.dasm (-6.06% of base)
         -66 : 8644.dasm (-12.74% of base)
         -61 : 24087.dasm (-8.56% of base)
         -57 : 16413.dasm (-7.89% of base)
         -54 : 22026.dasm (-10.13% of base)
         -51 : 25595.dasm (-6.00% of base)
         -48 : 22023.dasm (-8.42% of base)
         -48 : 2731.dasm (-15.19% of base)
         -47 : 12976.dasm (-8.90% of base)
         -39 : 6743.dasm (-7.59% of base)
         -32 : 25599.dasm (-11.81% of base)
         -32 : 9693.dasm (-18.82% of base)

107 total files with Code Size differences (102 improved, 5 regressed), 2 unchanged.

Top method regressions (bytes):
          56 ( 3.20% of base) : 12950.dasm - AssignJagged:second_assignments(System.Int32[][],System.Int16[][])
           9 ( 0.62% of base) : 18653.dasm - Microsoft.CodeAnalysis.CSharp.LocalRewriter:BuildStoresToTemps(bool,System.Collections.Immutable.ImmutableArray`1[Int32],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[RefKind],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.BoundExpression, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],bool,Microsoft.CodeAnalysis.CSharp.BoundExpression[],Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1[RefKind],Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1[[Microsoft.CodeAnalysis.CSharp.BoundAssignmentOperator, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]):this
           7 ( 0.67% of base) : 12449.dasm - Fourier:DoFPUTransIteration(System.Double[],System.Double[],int):long
           6 ( 0.30% of base) : 2623.dasm - System.Reflection.Emit.MethodBuilder:CreateMethodBodyHelper(System.Reflection.Emit.ILGenerator):this
           2 ( 0.06% of base) : 1559.dasm - ProtoBuf.Internal.Serializers.TypeSerializer`1[__Canon][System.__Canon]:ProtoBuf.Internal.Serializers.IRuntimeProtoSerializerNode.EmitRead(ProtoBuf.Compiler.CompilerContext,ProtoBuf.Compiler.Local):this

Top method improvements (bytes):
        -516 (-13.35% of base) : 25273.dasm - Benchstone.BenchI.MulMatrix:Inner(System.Int32[][],System.Int32[][],System.Int32[][])
        -430 (-12.65% of base) : 15682.dasm - LUDecomp:ludcmp(System.Double[][],int,System.Int32[],byref):int
        -116 (-1.06% of base) : 1451.dasm - System.DefaultBinder:BindToMethod(int,System.Reflection.MethodBase[],byref,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],byref):System.Reflection.MethodBase:this
        -112 (-9.80% of base) : 15681.dasm - LUDecomp:DoLUIteration(System.Double[][],System.Double[],System.Double[][][],System.Double[][],int):long
         -97 (-8.47% of base) : 15680.dasm - LUDecomp:build_problem(System.Double[][],int,System.Double[])
         -92 (-9.05% of base) : 11806.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]:this
         -75 (-6.91% of base) : 8012.dasm - System.DefaultBinder:FindMostSpecific(System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Type[],System.Object[]):int
         -72 (-9.17% of base) : 15683.dasm - LUDecomp:lubksb(System.Double[][],int,System.Int32[],System.Double[])
         -66 (-6.06% of base) : 3969.dasm - System.MulticastDelegate:CombineImpl(System.Delegate):System.Delegate:this
         -66 (-12.74% of base) : 8644.dasm - SciMark2.SparseCompRow:matmult(System.Double[],System.Double[],System.Int32[],System.Int32[],System.Double[],int)
         -61 (-8.56% of base) : 24087.dasm - SciMark2.SOR:execute(double,System.Double[][],int)
         -57 (-7.89% of base) : 16413.dasm - SciMark2.kernel:CopyMatrix(System.Double[][],System.Double[][])
         -54 (-10.13% of base) : 22026.dasm - Benchstone.BenchI.Array2:VerifyCopy(System.Int32[][][],System.Int32[][][]):bool
         -51 (-6.00% of base) : 25595.dasm - Benchstone.BenchF.InProd:Test():bool:this
         -48 (-8.42% of base) : 22023.dasm - Benchstone.BenchI.Array2:Bench(int):bool
         -48 (-15.19% of base) : 2731.dasm - System.Collections.Generic.GenericEqualityComparer`1[__Canon][System.__Canon]:IndexOf(System.__Canon[],System.__Canon,int,int):int:this
         -47 (-8.90% of base) : 12976.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int32TryParse(System.Char[],int,int,byref):int
         -39 (-7.59% of base) : 6743.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
         -32 (-11.81% of base) : 25599.dasm - Benchstone.BenchF.InProd:InnerProduct(byref,System.Double[][],System.Double[][],int,int)
         -32 (-18.82% of base) : 9693.dasm - System.Collections.Generic.GenericEqualityComparer`1[OpCode][System.Reflection.Emit.OpCode]:IndexOf(System.Reflection.Emit.OpCode[],System.Reflection.Emit.OpCode,int,int):int:this

Top method regressions (percentages):
          56 ( 3.20% of base) : 12950.dasm - AssignJagged:second_assignments(System.Int32[][],System.Int16[][])
           7 ( 0.67% of base) : 12449.dasm - Fourier:DoFPUTransIteration(System.Double[],System.Double[],int):long
           9 ( 0.62% of base) : 18653.dasm - Microsoft.CodeAnalysis.CSharp.LocalRewriter:BuildStoresToTemps(bool,System.Collections.Immutable.ImmutableArray`1[Int32],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[RefKind],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.BoundExpression, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],bool,Microsoft.CodeAnalysis.CSharp.BoundExpression[],Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1[RefKind],Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1[[Microsoft.CodeAnalysis.CSharp.BoundAssignmentOperator, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]):this
           6 ( 0.30% of base) : 2623.dasm - System.Reflection.Emit.MethodBuilder:CreateMethodBodyHelper(System.Reflection.Emit.ILGenerator):this
           2 ( 0.06% of base) : 1559.dasm - ProtoBuf.Internal.Serializers.TypeSerializer`1[__Canon][System.__Canon]:ProtoBuf.Internal.Serializers.IRuntimeProtoSerializerNode.EmitRead(ProtoBuf.Compiler.CompilerContext,ProtoBuf.Compiler.Local):this

Top method improvements (percentages):
         -32 (-18.82% of base) : 9693.dasm - System.Collections.Generic.GenericEqualityComparer`1[OpCode][System.Reflection.Emit.OpCode]:IndexOf(System.Reflection.Emit.OpCode[],System.Reflection.Emit.OpCode,int,int):int:this
         -48 (-15.19% of base) : 2731.dasm - System.Collections.Generic.GenericEqualityComparer`1[__Canon][System.__Canon]:IndexOf(System.__Canon[],System.__Canon,int,int):int:this
        -516 (-13.35% of base) : 25273.dasm - Benchstone.BenchI.MulMatrix:Inner(System.Int32[][],System.Int32[][],System.Int32[][])
         -66 (-12.74% of base) : 8644.dasm - SciMark2.SparseCompRow:matmult(System.Double[],System.Double[],System.Int32[],System.Int32[],System.Double[],int)
        -430 (-12.65% of base) : 15682.dasm - LUDecomp:ludcmp(System.Double[][],int,System.Int32[],byref):int
         -16 (-12.21% of base) : 16836.dasm - Roslyn.Utilities.Hash:GetFNVHashCode(System.Char[],int,int):int
         -20 (-11.90% of base) : 10547.dasm - System.Net.MultiArrayBuffer:FreeBlocks(int,int):this
         -32 (-11.81% of base) : 25599.dasm - Benchstone.BenchF.InProd:InnerProduct(byref,System.Double[][],System.Double[][],int,int)
         -16 (-11.27% of base) : 22835.dasm - Benchstone.BenchI.BubbleSort:VerifySort(System.Int32[],int):bool
         -16 (-11.11% of base) : 19819.dasm - System.Tests.Perf_String:IndexerCheckBoundCheckHoist():int:this
         -16 (-10.53% of base) : 17581.dasm - Roslyn.Utilities.StringTable:TextEqualsASCII(System.String,long,int):bool
         -30 (-10.49% of base) : 1382.dasm - System.Collections.Generic.ObjectEqualityComparer`1[__Canon][System.__Canon]:IndexOf(System.__Canon[],System.__Canon,int,int):int:this
         -54 (-10.13% of base) : 22026.dasm - Benchstone.BenchI.Array2:VerifyCopy(System.Int32[][][],System.Int32[][][]):bool
         -16 (-9.88% of base) : 19986.dasm - Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList:List(Microsoft.CodeAnalysis.GreenNode[],int):Microsoft.CodeAnalysis.GreenNode
        -112 (-9.80% of base) : 15681.dasm - LUDecomp:DoLUIteration(System.Double[][],System.Double[],System.Double[][][],System.Double[][],int):long
         -72 (-9.17% of base) : 15683.dasm - LUDecomp:lubksb(System.Double[][],int,System.Int32[],System.Double[])
         -92 (-9.05% of base) : 11806.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]:this
         -47 (-8.90% of base) : 12976.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int32TryParse(System.Char[],int,int,byref):int
         -17 (-8.63% of base) : 25673.dasm - Span.Sorting:TestBubbleSortArray(System.Int32[])
         -11 (-8.59% of base) : 13546.dasm - AssignRect:LoadAssignArrayWithRand(System.Int32[,][],int)

107 total methods with Code Size differences (102 improved, 5 regressed), 2 unchanged.


coreclr_tests.pmi.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 132280
Total bytes of diff: 127907
Total bytes of delta: -4373 (-3.31% of base)
Total relative delta: -9.14
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          56 : 176862.dasm (3.20% of base)
          22 : 227215.dasm (1.31% of base)
          22 : 227249.dasm (1.31% of base)
           7 : 176922.dasm (0.67% of base)
           5 : 195188.dasm (0.62% of base)
           5 : 231697.dasm (1.11% of base)
           4 : 173142.dasm (0.29% of base)
           4 : 173022.dasm (0.29% of base)
           4 : 173182.dasm (0.29% of base)
           2 : 232484.dasm (0.09% of base)
           1 : 234088.dasm (0.65% of base)

Top file improvements (bytes):
        -516 : 229119.dasm (-13.35% of base)
        -430 : 176941.dasm (-12.65% of base)
        -211 : 228174.dasm (-4.47% of base)
        -112 : 176939.dasm (-9.80% of base)
        -108 : 209769.dasm (-14.40% of base)
        -102 : 195536.dasm (-18.25% of base)
         -97 : 176940.dasm (-8.47% of base)
         -92 : 229034.dasm (-9.05% of base)
         -72 : 176942.dasm (-9.17% of base)
         -66 : 209783.dasm (-12.74% of base)
         -61 : 209781.dasm (-8.56% of base)
         -57 : 209757.dasm (-7.89% of base)
         -54 : 231338.dasm (-10.13% of base)
         -51 : 228182.dasm (-2.20% of base)
         -51 : 228195.dasm (-2.20% of base)
         -48 : 231339.dasm (-8.42% of base)
         -45 : 229093.dasm (-5.56% of base)
         -43 : 229097.dasm (-16.48% of base)
         -41 : 228163.dasm (-1.69% of base)
         -35 : 234146.dasm (-4.07% of base)

176 total files with Code Size differences (165 improved, 11 regressed), 3 unchanged.

Top method regressions (bytes):
          56 ( 3.20% of base) : 176862.dasm - AssignJagged:second_assignments(System.Int32[][],System.Int16[][])
          22 ( 1.31% of base) : 227215.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int
          22 ( 1.31% of base) : 227249.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int
           7 ( 0.67% of base) : 176922.dasm - Fourier:DoFPUTransIteration(System.Double[],System.Double[],int):long
           5 ( 0.62% of base) : 195188.dasm - NetClient.Program:Validate_Enumerator()
           5 ( 1.11% of base) : 231697.dasm - VectorMathTests.Program:sum(System.Numerics.Vector4[]):float
           4 ( 0.29% of base) : 173142.dasm - JIT.HardwareIntrinsics.X86.SimpleUnaryOpTest__ConvertToVector256Int64Int16:ValidateResult(System.Int16[],System.Int64[],System.String):this
           4 ( 0.29% of base) : 173022.dasm - JIT.HardwareIntrinsics.X86.SimpleUnaryOpTest__ConvertToVector256Int16SByte:ValidateResult(System.SByte[],System.Int16[],System.String):this
           4 ( 0.29% of base) : 173182.dasm - JIT.HardwareIntrinsics.X86.SimpleUnaryOpTest__ConvertToVector256Int64SByte:ValidateResult(System.SByte[],System.Int64[],System.String):this
           2 ( 0.09% of base) : 232484.dasm - Complex_Array_Test:Main(System.String[]):int
           1 ( 0.65% of base) : 234088.dasm - Buffer:.ctor(System.String):this

Top method improvements (bytes):
        -516 (-13.35% of base) : 229119.dasm - Benchstone.BenchI.MulMatrix:Inner(System.Int32[][],System.Int32[][],System.Int32[][])
        -430 (-12.65% of base) : 176941.dasm - LUDecomp:ludcmp(System.Double[][],int,System.Int32[],byref):int
        -211 (-4.47% of base) : 228174.dasm - jaggedarr:gaussj(System.Double[,][],int,System.Double[,][],int)
        -112 (-9.80% of base) : 176939.dasm - LUDecomp:DoLUIteration(System.Double[][],System.Double[],System.Double[][][],System.Double[][],int):long
        -108 (-14.40% of base) : 209769.dasm - SciMark2.LU:solve(System.Double[][],System.Int32[],System.Double[])
        -102 (-18.25% of base) : 195536.dasm - AsAnyTests:CharArrayInit(System.Char[],System.Char[],System.Char[],System.Char[],System.Char[],System.Char[],System.String,System.String)
         -97 (-8.47% of base) : 176940.dasm - LUDecomp:build_problem(System.Double[][],int,System.Double[])
         -92 (-9.05% of base) : 229034.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]
         -72 (-9.17% of base) : 176942.dasm - LUDecomp:lubksb(System.Double[][],int,System.Int32[],System.Double[])
         -66 (-12.74% of base) : 209783.dasm - SciMark2.SparseCompRow:matmult(System.Double[],System.Double[],System.Int32[],System.Int32[],System.Double[],int)
         -61 (-8.56% of base) : 209781.dasm - SciMark2.SOR:execute(double,System.Double[][],int)
         -57 (-7.89% of base) : 209757.dasm - SciMark2.kernel:CopyMatrix(System.Double[][],System.Double[][])
         -54 (-10.13% of base) : 231338.dasm - Benchstone.BenchI.Array2:VerifyCopy(System.Int32[][][],System.Int32[][][]):bool
         -51 (-2.20% of base) : 228182.dasm - plainarr:gaussj(System.Double[,],int,System.Double[,],int)
         -51 (-2.20% of base) : 228195.dasm - structarr:gaussj(MatrixStruct,int,MatrixStruct,int)
         -48 (-8.42% of base) : 231339.dasm - Benchstone.BenchI.Array2:Bench(int):bool
         -45 (-5.56% of base) : 229093.dasm - Benchstone.BenchF.InProd:Bench():bool
         -43 (-16.48% of base) : 229097.dasm - Benchstone.BenchF.InProd:InnerProduct(byref,System.Double[][],System.Double[][],int,int)
         -41 (-1.69% of base) : 228163.dasm - classarr:gaussj(MatrixCls,int,MatrixCls,int)
         -35 (-4.07% of base) : 234146.dasm - CTest:TestArrays1(int,double)

Top method regressions (percentages):
          56 ( 3.20% of base) : 176862.dasm - AssignJagged:second_assignments(System.Int32[][],System.Int16[][])
          22 ( 1.31% of base) : 227215.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int
          22 ( 1.31% of base) : 227249.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int
           5 ( 1.11% of base) : 231697.dasm - VectorMathTests.Program:sum(System.Numerics.Vector4[]):float
           7 ( 0.67% of base) : 176922.dasm - Fourier:DoFPUTransIteration(System.Double[],System.Double[],int):long
           1 ( 0.65% of base) : 234088.dasm - Buffer:.ctor(System.String):this
           5 ( 0.62% of base) : 195188.dasm - NetClient.Program:Validate_Enumerator()
           4 ( 0.29% of base) : 173142.dasm - JIT.HardwareIntrinsics.X86.SimpleUnaryOpTest__ConvertToVector256Int64Int16:ValidateResult(System.Int16[],System.Int64[],System.String):this
           4 ( 0.29% of base) : 173182.dasm - JIT.HardwareIntrinsics.X86.SimpleUnaryOpTest__ConvertToVector256Int64SByte:ValidateResult(System.SByte[],System.Int64[],System.String):this
           4 ( 0.29% of base) : 173022.dasm - JIT.HardwareIntrinsics.X86.SimpleUnaryOpTest__ConvertToVector256Int16SByte:ValidateResult(System.SByte[],System.Int16[],System.String):this
           2 ( 0.09% of base) : 232484.dasm - Complex_Array_Test:Main(System.String[]):int

Top method improvements (percentages):
         -30 (-24.59% of base) : 82072.dasm - GenericMethodPatchpoint:F(System.__Canon[],int,int):int
         -22 (-19.47% of base) : 81847.dasm - Test:Check(int)
         -21 (-19.44% of base) : 81740.dasm - VectorMathTests.Program:GenerateArray(int,int):System.Int32[]
         -21 (-19.09% of base) : 233889.dasm - VectorMathTests.Program:GenerateArray(int,short):System.Int16[]
        -102 (-18.25% of base) : 195536.dasm - AsAnyTests:CharArrayInit(System.Char[],System.Char[],System.Char[],System.Char[],System.Char[],System.Char[],System.String,System.String)
         -43 (-16.48% of base) : 229097.dasm - Benchstone.BenchF.InProd:InnerProduct(byref,System.Double[][],System.Double[][],int,int)
         -28 (-14.89% of base) : 229557.dasm - VectorMathTests.Program:SimpleFilter(System.Double[],System.Double[]):System.Double[]
         -20 (-14.81% of base) : 227238.dasm - DefaultNamespace.BitArrayNode:.ctor(int):this
        -108 (-14.40% of base) : 209769.dasm - SciMark2.LU:solve(System.Double[][],System.Int32[],System.Double[])
         -17 (-13.71% of base) : 229681.dasm - SimpleArray_01.Test:Test1()
        -516 (-13.35% of base) : 229119.dasm - Benchstone.BenchI.MulMatrix:Inner(System.Int32[][],System.Int32[][],System.Int32[][])
         -16 (-13.33% of base) : 209755.dasm - SciMark2.kernel:CopyVector(System.Double[],System.Double[])
         -66 (-12.74% of base) : 209783.dasm - SciMark2.SparseCompRow:matmult(System.Double[],System.Double[],System.Int32[],System.Int32[],System.Double[],int)
         -16 (-12.70% of base) : 209754.dasm - SciMark2.kernel:NewVectorCopy(System.Double[]):System.Double[]
        -430 (-12.65% of base) : 176941.dasm - LUDecomp:ludcmp(System.Double[][],int,System.Int32[],byref):int
         -12 (-12.63% of base) : 232402.dasm - BringUpTest:IntArraySum(System.Int32[],int):int
         -29 (-12.39% of base) : 206085.dasm - PartialCompactionTest.PartialCompactionTest:CreateObject(int,bool):System.Object
         -17 (-11.49% of base) : 209756.dasm - SciMark2.kernel:normabs(System.Double[],System.Double[]):double
         -16 (-11.27% of base) : 231369.dasm - Benchstone.BenchI.BubbleSort:VerifySort(System.Int32[],int):bool
         -35 (-11.04% of base) : 227046.dasm - ToBoxOrNotToBox.Program:PerfTest1(int,int)

176 total methods with Code Size differences (165 improved, 11 regressed), 3 unchanged.


libraries.crossgen2.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 251584
Total bytes of diff: 246165
Total bytes of delta: -5419 (-2.15% of base)
Total relative delta: -13.84
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          29 : 142278.dasm (0.28% of base)
          25 : 153346.dasm (1.02% of base)
           7 : 106529.dasm (0.35% of base)
           7 : 129682.dasm (0.36% of base)

Top file improvements (bytes):
         -74 : 173046.dasm (-6.53% of base)
         -74 : 142271.dasm (-6.48% of base)
         -73 : 165421.dasm (-12.35% of base)
         -67 : 144294.dasm (-6.44% of base)
         -59 : 146211.dasm (-19.47% of base)
         -58 : 18350.dasm (-13.88% of base)
         -52 : 169498.dasm (-7.08% of base)
         -52 : 177969.dasm (-7.08% of base)
         -48 : 10970.dasm (-3.23% of base)
         -48 : 125746.dasm (-15.14% of base)
         -46 : 173047.dasm (-8.21% of base)
         -46 : 142272.dasm (-7.99% of base)
         -45 : 10967.dasm (-3.27% of base)
         -45 : 186329.dasm (-8.57% of base)
         -42 : 9577.dasm (-8.32% of base)
         -42 : 9578.dasm (-8.02% of base)
         -39 : 205943.dasm (-8.28% of base)
         -39 : 18041.dasm (-1.34% of base)
         -38 : 122596.dasm (-21.71% of base)
         -38 : 125741.dasm (-12.79% of base)

326 total files with Code Size differences (322 improved, 4 regressed), 1 unchanged.

Top method regressions (bytes):
          29 ( 0.28% of base) : 142278.dasm - System.DefaultBinder:BindToMethod(int,System.Reflection.MethodBase[],byref,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],byref):System.Reflection.MethodBase:this
          25 ( 1.02% of base) : 153346.dasm - System.Linq.Expressions.Compiler.StackSpiller:RewriteListInitExpression(System.Linq.Expressions.Expression,int):System.Linq.Expressions.Compiler.StackSpiller+Result:this
           7 ( 0.35% of base) : 106529.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbolExtensions:InferExtensionMethodTypeArguments(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol,Microsoft.CodeAnalysis.Compilation,byref):Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol
           7 ( 0.36% of base) : 129682.dasm - System.Reflection.Emit.MethodBuilder:CreateMethodBodyHelper(System.Reflection.Emit.ILGenerator):this

Top method improvements (bytes):
         -74 (-6.53% of base) : 173046.dasm - System.DefaultBinder:FindMostSpecific(System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Type[],System.Object[]):int
         -74 (-6.48% of base) : 142271.dasm - System.DefaultBinder:FindMostSpecific(System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Type[],System.Object[]):int
         -73 (-12.35% of base) : 165421.dasm - System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteRectangle(System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo,int,System.Int32[],System.Array,System.Runtime.Serialization.Formatters.Binary.NameInfo,System.Int32[]):this
         -67 (-6.44% of base) : 144294.dasm - System.MulticastDelegate:CombineImpl(System.Delegate):System.Delegate:this
         -59 (-19.47% of base) : 146211.dasm - System.Collections.Generic.NullableEqualityComparer`1:IndexOf(System.Nullable`1[System.Int32][],System.Nullable`1[System.Int32],int,int):int:this
         -58 (-13.88% of base) : 18350.dasm - System.Data.SqlTypes.SqlString:CompareBinary2(System.Data.SqlTypes.SqlString,System.Data.SqlTypes.SqlString):int
         -52 (-7.08% of base) : 169498.dasm - DSACng:GenerateV2DsaBlob(byref,System.Security.Cryptography.DSAParameters,int,bool)
         -52 (-7.08% of base) : 177969.dasm - System.Security.Cryptography.DSACng:GenerateV2DsaBlob(byref,System.Security.Cryptography.DSAParameters,int,bool)
         -48 (-3.23% of base) : 10970.dasm - System.Text.ISO2022Encoding:GetCharsCP5022xJP(long,int,long,int,System.Text.ISO2022Encoding+ISO2022Decoder):int:this
         -48 (-15.14% of base) : 125746.dasm - System.Collections.Generic.GenericEqualityComparer`1:IndexOf(System.__Canon[],System.__Canon,int,int):int:this
         -46 (-8.21% of base) : 173047.dasm - System.DefaultBinder:ExactPropertyBinding(System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo
         -46 (-7.99% of base) : 142272.dasm - System.DefaultBinder:ExactPropertyBinding(System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo
         -45 (-3.27% of base) : 10967.dasm - System.Text.ISO2022Encoding:GetCharsCP50225KR(long,int,long,int,System.Text.ISO2022Encoding+ISO2022Decoder):int:this
         -45 (-8.57% of base) : 186329.dasm - System.Net.IPAddressParser:AppendSections(System.UInt16[],int,int,System.Text.StringBuilder)
         -42 (-8.32% of base) : 9577.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
         -42 (-8.02% of base) : 9578.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int32TryParse(System.Char[],int,int,byref):int
         -39 (-8.28% of base) : 205943.dasm - System.ComponentModel.Composition.ReflectionModel.GenericSpecializationPartCreationInfo:CanSpecialize(System.Collections.Generic.IDictionary`2[System.String, System.Object],System.Type[]):bool
         -39 (-1.34% of base) : 18041.dasm - System.Data.ProviderBase.SchemaMapping:SetupSchemaWithoutKeyInfo(int,int,bool,System.Data.DataColumn,System.Object):System.Object[]:this
         -38 (-21.71% of base) : 122596.dasm - Microsoft.CodeAnalysis.CSharp.Binder:CreateSourceIndicesArray(int,int):System.Int32[]
         -38 (-12.79% of base) : 125741.dasm - System.Collections.Generic.ObjectEqualityComparer`1:IndexOf(System.__Canon[],System.__Canon,int,int):int:this

Top method regressions (percentages):
          25 ( 1.02% of base) : 153346.dasm - System.Linq.Expressions.Compiler.StackSpiller:RewriteListInitExpression(System.Linq.Expressions.Expression,int):System.Linq.Expressions.Compiler.StackSpiller+Result:this
           7 ( 0.36% of base) : 129682.dasm - System.Reflection.Emit.MethodBuilder:CreateMethodBodyHelper(System.Reflection.Emit.ILGenerator):this
           7 ( 0.35% of base) : 106529.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbolExtensions:InferExtensionMethodTypeArguments(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol,Microsoft.CodeAnalysis.Compilation,byref):Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol
          29 ( 0.28% of base) : 142278.dasm - System.DefaultBinder:BindToMethod(int,System.Reflection.MethodBase[],byref,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],byref):System.Reflection.MethodBase:this

Top method improvements (percentages):
         -38 (-21.71% of base) : 122596.dasm - Microsoft.CodeAnalysis.CSharp.Binder:CreateSourceIndicesArray(int,int):System.Int32[]
         -59 (-19.47% of base) : 146211.dasm - System.Collections.Generic.NullableEqualityComparer`1:IndexOf(System.Nullable`1[System.Int32][],System.Nullable`1[System.Int32],int,int):int:this
         -22 (-16.79% of base) : 158915.dasm - Roslyn.Utilities.Hash:GetFNVHashCode(System.Char[],int,int):int
         -22 (-16.79% of base) : 158919.dasm - Roslyn.Utilities.Hash:GetFNVHashCode(System.String,int,int):int
         -15 (-16.48% of base) : 18046.dasm - System.Data.ProviderBase.SchemaMapping:CreateIndexMap(int,int):System.Int32[]:this
         -28 (-15.38% of base) : 50481.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertLinear8LinearShortByte(System.Int16[],int):System.Byte[]
         -48 (-15.14% of base) : 125746.dasm - System.Collections.Generic.GenericEqualityComparer`1:IndexOf(System.__Canon[],System.__Canon,int,int):int:this
         -24 (-15.00% of base) : 50483.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertLinear8LinearByteShort(System.Byte[],int):System.Int16[]
         -58 (-13.88% of base) : 18350.dasm - System.Data.SqlTypes.SqlString:CompareBinary2(System.Data.SqlTypes.SqlString,System.Data.SqlTypes.SqlString):int
         -38 (-12.79% of base) : 125741.dasm - System.Collections.Generic.ObjectEqualityComparer`1:IndexOf(System.__Canon[],System.__Canon,int,int):int:this
         -21 (-12.73% of base) : 18255.dasm - System.Data.SqlTypes.SqlBinary:HashByteArray(System.Byte[],int):int
         -17 (-12.50% of base) : 63557.dasm - System.Xml.Schema.DatatypeImplementation:Compare(System.Byte[],System.Byte[]):int:this
         -73 (-12.35% of base) : 165421.dasm - System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteRectangle(System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo,int,System.Int32[],System.Array,System.Runtime.Serialization.Formatters.Binary.NameInfo,System.Int32[]):this
         -27 (-12.05% of base) : 146484.dasm - System.Collections.Generic.EqualityComparer`1:IndexOf(System.Boolean[],bool,int,int):int:this
         -27 (-12.05% of base) : 146445.dasm - System.Collections.Generic.EqualityComparer`1:IndexOf(System.Char[],ushort,int,int):int:this
         -27 (-12.05% of base) : 146466.dasm - System.Collections.Generic.EqualityComparer`1:IndexOf(System.UInt16[],ushort,int,int):int:this
         -27 (-12.05% of base) : 146482.dasm - System.Collections.Generic.EqualityComparer`1:IndexOf(System.Byte[],ubyte,int,int):int:this
         -27 (-11.95% of base) : 146471.dasm - System.Collections.Generic.EqualityComparer`1:IndexOf(System.SByte[],byte,int,int):int:this
         -27 (-11.95% of base) : 146480.dasm - System.Collections.Generic.EqualityComparer`1:IndexOf(System.Int16[],short,int,int):int:this
         -17 (-11.72% of base) : 25504.dasm - Microsoft.CSharp.RuntimeBinder.Syntax.NameTable:ComputeHashCode(System.String,int):int

326 total methods with Code Size differences (322 improved, 4 regressed), 1 unchanged.


libraries.pmi.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 251055
Total bytes of diff: 245750
Total bytes of delta: -5305 (-2.11% of base)
Total relative delta: -14.83
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          33 : 24343.dasm (0.86% of base)
          25 : 123525.dasm (0.87% of base)
           8 : 28604.dasm (3.39% of base)
           8 : 233006.dasm (0.73% of base)
           6 : 42366.dasm (0.19% of base)
           2 : 113358.dasm (0.96% of base)
           2 : 123531.dasm (0.12% of base)
           1 : 143013.dasm (0.10% of base)

Top file improvements (bytes):
        -161 : 75872.dasm (-8.17% of base)
         -94 : 200832.dasm (-2.56% of base)
         -84 : 214598.dasm (-13.79% of base)
         -75 : 211745.dasm (-6.91% of base)
         -69 : 80051.dasm (-3.17% of base)
         -56 : 20379.dasm (-17.07% of base)
         -52 : 217281.dasm (-5.87% of base)
         -52 : 216589.dasm (-5.87% of base)
         -51 : 41480.dasm (-6.24% of base)
         -48 : 153293.dasm (-3.15% of base)
         -47 : 106680.dasm (-8.90% of base)
         -42 : 211744.dasm (-7.55% of base)
         -42 : 153296.dasm (-2.95% of base)
         -41 : 23735.dasm (-21.69% of base)
         -39 : 176846.dasm (-7.83% of base)
         -39 : 106681.dasm (-7.59% of base)
         -38 : 183916.dasm (-1.71% of base)
         -37 : 76616.dasm (-11.46% of base)
         -36 : 113888.dasm (-8.57% of base)
         -36 : 111847.dasm (-9.30% of base)

323 total files with Code Size differences (315 improved, 8 regressed), 11 unchanged.

Top method regressions (bytes):
          33 ( 0.86% of base) : 24343.dasm - Microsoft.CodeAnalysis.CSharp.OverloadResolution:IsApplicable(Microsoft.CodeAnalysis.CSharp.Symbol,EffectiveParameters,Microsoft.CodeAnalysis.CSharp.AnalyzedArguments,System.Collections.Immutable.ImmutableArray`1[Int32],bool,bool,bool,byref):Microsoft.CodeAnalysis.CSharp.MemberAnalysisResult:this
          25 ( 0.87% of base) : 123525.dasm - System.Linq.Expressions.Compiler.StackSpiller:RewriteListInitExpression(System.Linq.Expressions.Expression,int):Result:this
           8 ( 3.39% of base) : 28604.dasm - Microsoft.CodeAnalysis.CSharp.DiagnosticsPass:IsComCallWithRefOmitted(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.BoundExpression, Microsoft.CodeAnalysis.CSharp, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[RefKind]):bool
           8 ( 0.73% of base) : 233006.dasm - ArraySerializer:Deserialize(Xunit.Abstractions.IXunitSerializationInfo):this
           6 ( 0.19% of base) : 42366.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbolExtensions:InferExtensionMethodTypeArguments(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol,Microsoft.CodeAnalysis.Compilation,byref):Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol
           2 ( 0.96% of base) : 113358.dasm - System.Data.SqlTypes.SqlDecimal:GetHashCode():int:this
           2 ( 0.12% of base) : 123531.dasm - System.Linq.Expressions.Compiler.StackSpiller:RewriteSwitchExpression(System.Linq.Expressions.Expression,int):Result:this
           1 ( 0.10% of base) : 143013.dasm - System.Xml.Xsl.XsltOld.XsltCompileContext:FindBestMethod(System.Reflection.MethodInfo[],bool,bool,System.String,System.Xml.XPath.XPathResultType[]):System.Reflection.MethodInfo:this

Top method improvements (bytes):
        -161 (-8.17% of base) : 75872.dasm - Microsoft.Cci.CustomDebugInfoWriter:SerializeDynamicLocalInfo(Microsoft.Cci.IMethodBody,Microsoft.CodeAnalysis.ArrayBuilder`1[[Microsoft.Cci.BlobBuilder, Microsoft.CodeAnalysis, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]])
         -94 (-2.56% of base) : 200832.dasm - System.Management.PropertyData:MapValueToWmiValue(System.Object,byref,byref):System.Object
         -84 (-13.79% of base) : 214598.dasm - System.Runtime.Serialization.Formatters.Binary.ObjectWriter:WriteRectangle(System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo,int,System.Int32[],System.Array,System.Runtime.Serialization.Formatters.Binary.NameInfo,System.Int32[]):this
         -75 (-6.91% of base) : 211745.dasm - System.DefaultBinder:FindMostSpecific(System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Reflection.ParameterInfo[],System.Int32[],System.Type,System.Type[],System.Object[]):int
         -69 (-3.17% of base) : 80051.dasm - Microsoft.CodeAnalysis.Emit.DeltaMetadataWriter:GetDelta(Microsoft.CodeAnalysis.Emit.EmitBaseline,Microsoft.CodeAnalysis.Compilation,System.Guid,Microsoft.Cci.MetadataSizes):Microsoft.CodeAnalysis.Emit.EmitBaseline:this
         -56 (-17.07% of base) : 20379.dasm - System.Collections.Generic.NullableEqualityComparer`1[Byte][System.Byte]:IndexOf(System.Nullable`1[System.Byte][],System.Nullable`1[Byte],int,int):int:this
         -52 (-5.87% of base) : 217281.dasm - System.Security.Cryptography.DSACng:GenerateV2DsaBlob(byref,System.Security.Cryptography.DSAParameters,int,bool)
         -52 (-5.87% of base) : 216589.dasm - DSACng:GenerateV2DsaBlob(byref,System.Security.Cryptography.DSAParameters,int,bool)
         -51 (-6.24% of base) : 41480.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol:EqualsComplicatedCases(Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol,bool,bool):bool:this
         -48 (-3.15% of base) : 153293.dasm - System.Text.ISO2022Encoding:GetCharsCP5022xJP(long,int,long,int,ISO2022Decoder):int:this
         -47 (-8.90% of base) : 106680.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int32TryParse(System.Char[],int,int,byref):int
         -42 (-7.55% of base) : 211744.dasm - System.DefaultBinder:ExactPropertyBinding(System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo
         -42 (-2.95% of base) : 153296.dasm - System.Text.ISO2022Encoding:GetCharsCP50225KR(long,int,long,int,ISO2022Decoder):int:this
         -41 (-21.69% of base) : 23735.dasm - Microsoft.CodeAnalysis.CSharp.Binder:CreateSourceIndicesArray(int,int):System.Int32[]
         -39 (-7.83% of base) : 176846.dasm - System.ComponentModel.Composition.ReflectionModel.GenericSpecializationPartCreationInfo:CanSpecialize(System.Collections.Generic.IDictionary`2[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],System.Type[]):bool
         -39 (-7.59% of base) : 106681.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
         -38 (-1.71% of base) : 183916.dasm - System.Data.Odbc.OdbcDataReader:RetrieveKeyInfoFromStatistics(QualifiedTableName,bool):int:this
         -37 (-11.46% of base) : 76616.dasm - Microsoft.CodeAnalysis.BitVector:IntersectWith(Microsoft.CodeAnalysis.BitVector):bool:this
         -36 (-8.57% of base) : 113888.dasm - System.Data.SqlTypes.SqlString:CompareBinary2(System.Data.SqlTypes.SqlString,System.Data.SqlTypes.SqlString):int
         -36 (-9.30% of base) : 111847.dasm - System.Data.DataTable:RecordChanged(System.Int32[],System.Int32[]):this

Top method regressions (percentages):
           8 ( 3.39% of base) : 28604.dasm - Microsoft.CodeAnalysis.CSharp.DiagnosticsPass:IsComCallWithRefOmitted(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.BoundExpression, Microsoft.CodeAnalysis.CSharp, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[RefKind]):bool
           2 ( 0.96% of base) : 113358.dasm - System.Data.SqlTypes.SqlDecimal:GetHashCode():int:this
          25 ( 0.87% of base) : 123525.dasm - System.Linq.Expressions.Compiler.StackSpiller:RewriteListInitExpression(System.Linq.Expressions.Expression,int):Result:this
          33 ( 0.86% of base) : 24343.dasm - Microsoft.CodeAnalysis.CSharp.OverloadResolution:IsApplicable(Microsoft.CodeAnalysis.CSharp.Symbol,EffectiveParameters,Microsoft.CodeAnalysis.CSharp.AnalyzedArguments,System.Collections.Immutable.ImmutableArray`1[Int32],bool,bool,bool,byref):Microsoft.CodeAnalysis.CSharp.MemberAnalysisResult:this
           8 ( 0.73% of base) : 233006.dasm - ArraySerializer:Deserialize(Xunit.Abstractions.IXunitSerializationInfo):this
           6 ( 0.19% of base) : 42366.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbolExtensions:InferExtensionMethodTypeArguments(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol,Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol,Microsoft.CodeAnalysis.Compilation,byref):Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol
           2 ( 0.12% of base) : 123531.dasm - System.Linq.Expressions.Compiler.StackSpiller:RewriteSwitchExpression(System.Linq.Expressions.Expression,int):Result:this
           1 ( 0.10% of base) : 143013.dasm - System.Xml.Xsl.XsltOld.XsltCompileContext:FindBestMethod(System.Reflection.MethodInfo[],bool,bool,System.String,System.Xml.XPath.XPathResultType[]):System.Reflection.MethodInfo:this

Top method improvements (percentages):
         -32 (-22.22% of base) : 41398.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol:TypeParametersMatchTypeArguments(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.Symbols.TypeParameterSymbol, Microsoft.CodeAnalysis.CSharp, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol, Microsoft.CodeAnalysis.CSharp, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]):bool
         -41 (-21.69% of base) : 23735.dasm - Microsoft.CodeAnalysis.CSharp.Binder:CreateSourceIndicesArray(int,int):System.Int32[]
         -23 (-21.50% of base) : 114248.dasm - System.Data.ProviderBase.SchemaMapping:CreateIndexMap(int,int):System.Int32[]:this
         -27 (-20.45% of base) : 20377.dasm - System.Collections.Generic.GenericEqualityComparer`1[Int64][System.Int64]:IndexOf(System.Int64[],long,int,int):int:this
         -32 (-19.28% of base) : 209091.dasm - System.Numerics.Tensors.ArrayUtilities:GetIndex(System.Int32[],System.ReadOnlySpan`1[Int32],int):int
         -26 (-17.93% of base) : 20360.dasm - System.Collections.Generic.GenericEqualityComparer`1[Byte][System.Byte]:IndexOf(System.Byte[],ubyte,int,int):int:this
         -26 (-17.93% of base) : 20366.dasm - System.Collections.Generic.GenericEqualityComparer`1[Int16][System.Int16]:IndexOf(System.Int16[],short,int,int):int:this
         -32 (-17.20% of base) : 151925.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertLinear8LinearByteShort(System.Byte[],int):System.Int16[]
         -56 (-17.07% of base) : 20379.dasm - System.Collections.Generic.NullableEqualityComparer`1[Byte][System.Byte]:IndexOf(System.Nullable`1[System.Byte][],System.Nullable`1[Byte],int,int):int:this
         -25 (-16.45% of base) : 209460.dasm - System.Numerics.Tensors.Tensor`1[Int64][System.Int64]:get_Item(System.ReadOnlySpan`1[Int32]):long:this
         -25 (-16.45% of base) : 209412.dasm - System.Numerics.Tensors.Tensor`1[Int32][System.Int32]:get_Item(System.ReadOnlySpan`1[Int32]):int:this
         -25 (-16.45% of base) : 209397.dasm - System.Numerics.Tensors.Tensor`1[Int16][System.Int16]:get_Item(System.ReadOnlySpan`1[Int32]):short:this
         -25 (-16.45% of base) : 209375.dasm - System.Numerics.Tensors.Tensor`1[Byte][System.Byte]:get_Item(System.ReadOnlySpan`1[Int32]):ubyte:this
         -25 (-16.45% of base) : 209311.dasm - System.Numerics.Tensors.Tensor`1[__Canon][System.__Canon]:get_Item(System.ReadOnlySpan`1[Int32]):System.__Canon:this
         -23 (-16.31% of base) : 138992.dasm - System.Xml.Schema.DatatypeImplementation:Compare(System.Byte[],System.Byte[]):int:this
         -24 (-16.00% of base) : 209461.dasm - System.Numerics.Tensors.Tensor`1[Int64][System.Int64]:set_Item(System.ReadOnlySpan`1[Int32],long):this
         -24 (-16.00% of base) : 209413.dasm - System.Numerics.Tensors.Tensor`1[Int32][System.Int32]:set_Item(System.ReadOnlySpan`1[Int32],int):this
         -24 (-16.00% of base) : 209312.dasm - System.Numerics.Tensors.Tensor`1[__Canon][System.__Canon]:set_Item(System.ReadOnlySpan`1[Int32],System.__Canon):this
         -30 (-15.62% of base) : 20373.dasm - System.Collections.Generic.GenericEqualityComparer`1[Vector`1][System.Numerics.Vector`1[System.Single]]:IndexOf(System.Numerics.Vector`1[System.Single][],System.Numerics.Vector`1[Single],int,int):int:this
         -24 (-15.58% of base) : 209398.dasm - System.Numerics.Tensors.Tensor`1[Int16][System.Int16]:set_Item(System.ReadOnlySpan`1[Int32],short):this

323 total methods with Code Size differences (315 improved, 8 regressed), 11 unchanged.


libraries_tests.pmi.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 499553
Total bytes of diff: 491715
Total bytes of delta: -7838 (-1.57% of base)
Total relative delta: -19.59
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          62 : 339129.dasm (1.50% of base)
           9 : 175927.dasm (1.54% of base)
           4 : 192030.dasm (0.32% of base)
           4 : 68303.dasm (0.32% of base)
           3 : 192283.dasm (0.06% of base)
           3 : 296608.dasm (0.82% of base)
           3 : 68144.dasm (0.06% of base)
           2 : 191979.dasm (0.05% of base)
           2 : 68251.dasm (0.05% of base)
           2 : 176599.dasm (0.74% of base)
           1 : 192036.dasm (0.03% of base)
           1 : 68309.dasm (0.03% of base)
           1 : 336516.dasm (0.03% of base)

Top file improvements (bytes):
         -66 : 67977.dasm (-4.54% of base)
         -62 : 176977.dasm (-5.37% of base)
         -62 : 176393.dasm (-5.37% of base)
         -58 : 7611.dasm (-31.87% of base)
         -48 : 285829.dasm (-24.74% of base)
         -48 : 285403.dasm (-24.74% of base)
         -45 : 176896.dasm (-5.43% of base)
         -45 : 176300.dasm (-5.43% of base)
         -42 : 19480.dasm (-3.60% of base)
         -42 : 19525.dasm (-3.60% of base)
         -40 : 72814.dasm (-2.47% of base)
         -34 : 176764.dasm (-6.94% of base)
         -34 : 215515.dasm (-4.52% of base)
         -34 : 219735.dasm (-4.52% of base)
         -34 : 176773.dasm (-6.76% of base)
         -33 : 68487.dasm (-1.96% of base)
         -33 : 192213.dasm (-1.96% of base)
         -32 : 176771.dasm (-4.94% of base)
         -32 : 176772.dasm (-5.93% of base)
         -32 : 215252.dasm (-2.32% of base)

551 total files with Code Size differences (538 improved, 13 regressed), 15 unchanged.

Top method regressions (bytes):
          62 ( 1.50% of base) : 339129.dasm - System.Transactions.Tests.NonMsdtcPromoterTests:TestCase_PSPENonMsdtc(bool,bool,int,int,int,int,int,int,int)
           9 ( 1.54% of base) : 175927.dasm - System.Memory.Tests.SequenceReader.SequenceFactory:Create(System.Byte[][]):System.Buffers.ReadOnlySequence`1[Byte]
           4 ( 0.32% of base) : 192030.dasm - System.Tests.StringTests:TrimCharacterAtEnd()
           4 ( 0.32% of base) : 68303.dasm - System.Tests.StringTests:TrimCharacterAtEnd()
           3 ( 0.06% of base) : 192283.dasm - System.Tests.StringTests:OnlyWhiteSpaceTrim_Memory()
           3 ( 0.82% of base) : 296608.dasm - System.Net.Tests.HttpListenerPrefixCollectionTests:CopyTo_StringArray_ReturnsExpected(int):this
           3 ( 0.06% of base) : 68144.dasm - System.Tests.StringTests:OnlyWhiteSpaceTrim_Memory()
           2 ( 0.05% of base) : 191979.dasm - System.Tests.StringTests:TrimCharactersMultipleTimes()
           2 ( 0.05% of base) : 68251.dasm - System.Tests.StringTests:TrimCharactersMultipleTimes()
           2 ( 0.74% of base) : 176599.dasm - System.SpanTests.ReadOnlySpanTests:TestMultipleContains()
           1 ( 0.03% of base) : 192036.dasm - System.Tests.StringTests:NoTrimCharacters()
           1 ( 0.03% of base) : 68309.dasm - System.Tests.StringTests:NoTrimCharacters()
           1 ( 0.03% of base) : 336516.dasm - System.Threading.Tasks.Test.ParallelStateTest:.ctor(System.Threading.Tasks.Test.TestParameters):this

Top method improvements (bytes):
         -66 (-4.54% of base) : 67977.dasm - System.Runtime.CompilerServices.Tests.ConditionalWeakTableTests:AddMany_ThenRemoveAll(int)
         -62 (-5.37% of base) : 176977.dasm - System.SpanTests.SpanTests:TestMatchIndexOfAny_TwoString()
         -62 (-5.37% of base) : 176393.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchIndexOfAny_TwoString()
         -58 (-31.87% of base) : 7611.dasm - Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver:IsSubStringEqual(System.String,System.String,int):bool
         -48 (-24.74% of base) : 285829.dasm - System.IO.Compression.Tests.ZipFileTestBase:ArraysEqual(System.Byte[],System.Byte[],int):bool
         -48 (-24.74% of base) : 285403.dasm - System.IO.Compression.Tests.ZipFileTestBase:ArraysEqual(System.Byte[],System.Byte[],int):bool
         -45 (-5.43% of base) : 176896.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_String_TwoByte()
         -45 (-5.43% of base) : 176300.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchLastIndexOfAny_String_TwoByte()
         -42 (-3.60% of base) : 19480.dasm - System.Collections.Tests.Dictionary_Generic_Tests`2[__Canon,Nullable`1][System.__Canon,System.Nullable`1[System.Int32]]:TrimExcess_NoArgument_TrimAfterEachBulkAddOrRemove_TrimsToAtLeastCount(int,int,int,int,int):this
         -42 (-3.60% of base) : 19525.dasm - System.Collections.Tests.Dictionary_Generic_Tests`2[Byte,Nullable`1][System.Byte,System.Nullable`1[System.Int32]]:TrimExcess_NoArgument_TrimAfterEachBulkAddOrRemove_TrimsToAtLeastCount(int,int,int,int,int):this
         -40 (-2.47% of base) : 72814.dasm - <>c:<Add>b__1_0(int):System.Tuple`3[[System.Runtime.CompilerServices.ConditionalWeakTable`2[[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.WeakReference[], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.WeakReference[], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]:this
         -34 (-6.94% of base) : 176764.dasm - System.SpanTests.SpanTests:SequenceCompareToNoMatch_Bool()
         -34 (-4.52% of base) : 215515.dasm - Microsoft.SqlServer.Server.SqlDataRecord:SetValues(System.Object[]):int:this
         -34 (-4.52% of base) : 219735.dasm - Microsoft.SqlServer.Server.SqlDataRecord:SetValues(System.Object[]):int:this
         -34 (-6.76% of base) : 176773.dasm - System.SpanTests.SpanTests:SequenceCompareToNoMatch_Byte()
         -33 (-1.96% of base) : 68487.dasm - System.Tests.StringTests:ContainsNoMatch_StringComparison()
         -33 (-1.96% of base) : 192213.dasm - System.Tests.StringTests:ContainsNoMatch_StringComparison()
         -32 (-4.94% of base) : 176771.dasm - System.SpanTests.SpanTests:SequenceCompareToEqual_Byte()
         -32 (-5.93% of base) : 176772.dasm - System.SpanTests.SpanTests:SequenceCompareToWithSingleMismatch_Byte()
         -32 (-2.32% of base) : 215252.dasm - XmlCoreTest.Common.WriterFactory:CompareString(System.String):bool:this

Top method regressions (percentages):
           9 ( 1.54% of base) : 175927.dasm - System.Memory.Tests.SequenceReader.SequenceFactory:Create(System.Byte[][]):System.Buffers.ReadOnlySequence`1[Byte]
          62 ( 1.50% of base) : 339129.dasm - System.Transactions.Tests.NonMsdtcPromoterTests:TestCase_PSPENonMsdtc(bool,bool,int,int,int,int,int,int,int)
           3 ( 0.82% of base) : 296608.dasm - System.Net.Tests.HttpListenerPrefixCollectionTests:CopyTo_StringArray_ReturnsExpected(int):this
           2 ( 0.74% of base) : 176599.dasm - System.SpanTests.ReadOnlySpanTests:TestMultipleContains()
           4 ( 0.32% of base) : 192030.dasm - System.Tests.StringTests:TrimCharacterAtEnd()
           4 ( 0.32% of base) : 68303.dasm - System.Tests.StringTests:TrimCharacterAtEnd()
           3 ( 0.06% of base) : 192283.dasm - System.Tests.StringTests:OnlyWhiteSpaceTrim_Memory()
           3 ( 0.06% of base) : 68144.dasm - System.Tests.StringTests:OnlyWhiteSpaceTrim_Memory()
           2 ( 0.05% of base) : 191979.dasm - System.Tests.StringTests:TrimCharactersMultipleTimes()
           2 ( 0.05% of base) : 68251.dasm - System.Tests.StringTests:TrimCharactersMultipleTimes()
           1 ( 0.03% of base) : 192036.dasm - System.Tests.StringTests:NoTrimCharacters()
           1 ( 0.03% of base) : 68309.dasm - System.Tests.StringTests:NoTrimCharacters()
           1 ( 0.03% of base) : 336516.dasm - System.Threading.Tasks.Test.ParallelStateTest:.ctor(System.Threading.Tasks.Test.TestParameters):this

Top method improvements (percentages):
         -58 (-31.87% of base) : 7611.dasm - Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver:IsSubStringEqual(System.String,System.String,int):bool
         -29 (-25.22% of base) : 44209.dasm - System.Linq.Expressions.Tests.ArrayIndexTests:GenerateGenericArray(int):System.__Canon[]
         -48 (-24.74% of base) : 285829.dasm - System.IO.Compression.Tests.ZipFileTestBase:ArraysEqual(System.Byte[],System.Byte[],int):bool
         -48 (-24.74% of base) : 285403.dasm - System.IO.Compression.Tests.ZipFileTestBase:ArraysEqual(System.Byte[],System.Byte[],int):bool
         -24 (-22.02% of base) : 196831.dasm - XmlDictionaryWriterTest:GetByteArray(int):System.Byte[]
         -24 (-22.02% of base) : 194572.dasm - XmlDictionaryWriterTest:GetByteArray(int):System.Byte[]
         -24 (-22.02% of base) : 44210.dasm - System.Linq.Expressions.Tests.ArrayIndexTests:GenerateGenericArray(int):System.Byte[]
         -21 (-19.09% of base) : 203534.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 203943.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 283859.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 328736.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 329504.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 200000.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 327668.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 189575.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 201241.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -21 (-19.09% of base) : 282408.dasm - Test.Cryptography.ByteUtils:RepeatByte(ubyte,int):System.Byte[]
         -22 (-12.64% of base) : 1607.dasm - Roslyn.Utilities.PathUtilities:PathsEqual(System.String,System.String,int):bool
         -16 (-12.21% of base) : 985.dasm - Roslyn.Utilities.Hash:GetFNVHashCode(System.Char[],int,int):int
         -26 (-12.09% of base) : 266812.dasm - <>c__DisplayClass13_0:<TryPopRange_InvalidArguments_Throws>b__2():System.Object:this

551 total methods with Code Size differences (538 improved, 13 regressed), 15 unchanged.


@BruceForstall
Copy link
Contributor Author

The microbenchmarks numbers are more mixed:

Improvements (from largest to smallest, based on ratio)

Method Toolchain Mean Error StdDev Median Min Max Ratio
benchSparseMult baseline 618.3 ms 5.85 ms 4.89 ms 618.1 ms 612.3 ms 629.4 ms 1.00
benchSparseMult diff 435.7 ms 2.79 ms 2.61 ms 435.4 ms 431.6 ms 441.2 ms 0.70
BenchMk2 baseline 1.474 s 0.0199 s 0.0167 s 1.467 s 1.459 s 1.515 s 1.00
BenchMk2 diff 1.293 s 0.0106 s 0.0099 s 1.294 s 1.275 s 1.308 s 0.88
BenchLUDecomp baseline 1,225.4 ms 21.29 ms 19.91 ms 1,227.9 ms 1,198.0 ms 1,256.9 ms 1.00
BenchLUDecomp diff 1,077.7 ms 11.76 ms 11.00 ms 1,076.2 ms 1,050.8 ms 1,097.6 ms 0.88
Simpsn baseline 1.689 s 0.0098 s 0.0087 s 1.690 s 1.671 s 1.702 s 1.00
Simpsn diff 1.511 s 0.0118 s 0.0105 s 1.507 s 1.498 s 1.532 s 0.89
IniArray baseline 44.06 ms 0.762 ms 0.675 ms 43.91 ms 43.23 ms 45.60 ms 1.00
IniArray diff 41.38 ms 0.489 ms 0.408 ms 41.43 ms 40.70 ms 42.20 ms 0.94
FFT baseline 1.644 s 0.0114 s 0.0095 s 1.640 s 1.631 s 1.660 s 1.00
FFT diff 1.577 s 0.0116 s 0.0108 s 1.576 s 1.559 s 1.595 s 0.96
benchFFT baseline 756.2 ms 2.72 ms 2.41 ms 756.6 ms 752.6 ms 761.3 ms 1.00
benchFFT diff 722.7 ms 4.36 ms 3.40 ms 723.4 ms 717.2 ms 727.6 ms 0.96
benchSOR baseline 867.8 ms 10.18 ms 9.03 ms 870.4 ms 852.9 ms 880.4 ms 1.00
benchSOR diff 841.2 ms 5.26 ms 4.40 ms 842.1 ms 829.2 ms 847.0 ms 0.97
TreeInsert baseline 55.88 us 0.539 us 0.450 us 55.80 us 55.29 us 56.78 us 1.00
TreeInsert diff 54.06 us 0.805 us 0.672 us 54.02 us 52.85 us 55.25 us 0.97
BenchNeuralJagged baseline 959.2 ms 4.94 ms 4.38 ms 958.3 ms 952.1 ms 968.3 ms 1.00
BenchNeuralJagged diff 928.8 ms 4.29 ms 3.81 ms 929.9 ms 920.3 ms 934.0 ms 0.97

Regressions (from largest to smallest, based on ratio)

Method Toolchain Mean Error StdDev Median Min Max Ratio
NewtR baseline 74.50 ms 0.654 ms 0.612 ms 74.69 ms 73.51 ms 75.37 ms 1.00
NewtR diff 92.91 ms 1.410 ms 1.319 ms 92.96 ms 90.72 ms 95.58 ms 1.25
Trap baseline 1.323 s 0.0069 s 0.0065 s 1.321 s 1.314 s 1.335 s 1.00
Trap diff 1.456 s 0.0152 s 0.0142 s 1.453 s 1.436 s 1.482 s 1.10
XposMatrix baseline 13.92 us 0.138 us 0.129 us 13.92 us 13.70 us 14.11 us 1.00
XposMatrix diff 15.04 us 0.070 us 0.062 us 15.04 us 14.96 us 15.17 us 1.08
BenchNumericSortJagged baseline 1,291.0 ms 14.02 ms 13.12 ms 1,286.1 ms 1,271.1 ms 1,313.2 ms 1.00
BenchNumericSortJagged diff 1,390.3 ms 24.03 ms 21.31 ms 1,388.1 ms 1,355.8 ms 1,425.4 ms 1.08
MulMatrix baseline 287.0 ms 6.84 ms 7.03 ms 284.2 ms 278.8 ms 305.3 ms 1.00
MulMatrix diff 306.4 ms 1.35 ms 1.19 ms 306.6 ms 303.7 ms 307.9 ms 1.06
NDhrystone baseline 449.4 ms 3.27 ms 2.55 ms 449.7 ms 443.0 ms 452.2 ms 1.00
NDhrystone diff 475.7 ms 4.29 ms 3.80 ms 476.6 ms 466.4 ms 480.2 ms 1.06
Ackermann baseline 2.930 us 0.0202 us 0.0189 us 2.921 us 2.901 us 2.965 us 1.00
Ackermann diff 3.081 us 0.0456 us 0.0427 us 3.066 us 3.015 us 3.160 us 1.05
BubbleSort baseline 9.073 us 0.1027 us 0.0961 us 9.063 us 8.917 us 9.304 us 1.00
BubbleSort diff 9.426 us 0.1107 us 0.1036 us 9.393 us 9.272 us 9.612 us 1.04
CSieve baseline 3.941 ms 0.0635 ms 0.0594 ms 3.926 ms 3.874 ms 4.050 ms 1.00
CSieve diff 4.116 ms 0.0497 ms 0.0465 ms 4.104 ms 4.061 ms 4.214 ms 1.04
Midpoint baseline 453.3 ms 5.08 ms 4.75 ms 452.6 ms 443.1 ms 461.5 ms 1.00
Midpoint diff 469.5 ms 6.49 ms 6.07 ms 470.6 ms 460.5 ms 480.1 ms 1.04
BenchAssignJagged baseline 913.9 ms 5.23 ms 4.63 ms 913.3 ms 907.0 ms 920.3 ms 1.00
BenchAssignJagged diff 954.0 ms 11.00 ms 10.29 ms 953.4 ms 941.2 ms 976.8 ms 1.04
BenchEmFloatClass baseline 602.3 ms 3.52 ms 3.29 ms 602.6 ms 594.4 ms 606.2 ms 1.00
BenchEmFloatClass diff 619.4 ms 3.41 ms 3.19 ms 619.4 ms 614.9 ms 626.7 ms 1.03
BenchFourier baseline 2,473.6 ms 31.85 ms 28.24 ms 2,481.5 ms 2,422.8 ms 2,522.8 ms 1.00
BenchFourier diff 2,551.5 ms 17.02 ms 15.92 ms 2,553.0 ms 2,527.8 ms 2,575.3 ms 1.03
InProd baseline 1.134 s 0.0137 s 0.0128 s 1.132 s 1.117 s 1.164 s 1.00
InProd diff 1.173 s 0.0153 s 0.0143 s 1.169 s 1.153 s 1.200 s 1.03

This is from a run of:

dotnet run -c Release -f net6.0 -- --filter *ByteMark* *BenchI* *BenchF* *SciMark2* *SpectralNorm_1* *FannkuchRedux_2* --coreRun C:\gh\runtime2\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\CoreRun.exe C:\gh\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\CoreRun.exe -e GitHub

with a lot of manual data report post-processing.

@EgorBo
Copy link
Member

EgorBo commented Oct 2, 2021

From my understanding it might regress harder on arm64 where branch prediction is not that great

@BruceForstall
Copy link
Contributor Author

From my understanding it might regress harder on arm64 where branch prediction is not that great

Do you have a pointer to data or spec on this?

In this case, simple static "predict forward conditional branch not taken" is sufficient.

@BruceForstall
Copy link
Contributor Author

A rerun of the "regressions" shows NewtR with no regression (it has no diffs), Trap with a 5% improvement (!), BenchNumericSortJagged, and BenchEmFloatClass also with improvements.

@JulieLeeMSFT
Copy link
Member

Trap with a 5% improvement (!), BenchNumericSortJagged, and BenchEmFloatClass also with improvements.

Very good.
Does this improvement come from the change that generate each condition in a separate block?

@BruceForstall
Copy link
Contributor Author

Does this improvement come from the change that generate each condition in a separate block?

There are many cases where that is the case. For "Trap", however, it once showed a 10% regression, then showed a 5% improvement, with the same JIT code, and in neither case are there any asm diffs in the benchmark! It makes it hard to trust the numbers on any of the benchmarks.

Add an option, statically determined at compile time,
to generate loop cloning loop choice conditions into one block
per condition instead of using bitwise `and` operators that
execute all non-dependent conditions in a single block. Set the
condition to use the one-block-per-condition mode.

This leads to code size reduction in the generated condition code,
generally performance improvements in the microbenchmarks,
as well as making it easier to understand.
@BruceForstall
Copy link
Contributor Author

Rerunning XposMatrix shows a consistent 7% improvement... but no asm diffs.

@BruceForstall
Copy link
Contributor Author

I can only consistently reproduce regressions in 2 benchmarks:

  1. MulMatrix has a 6% regression. It seems to get unlucky with the jcc erratum: the inner loops have 5 more "jcc erratum" cases than the baseline. Overall, the diff shrinks total code size from 3864 to 3348, frame size from 56 to 40, and optimizes away some constant checks that the JIT didn't understand with the previous code form.
  2. NDhrystone shows 6-11% regressions. However, the only asm diffs are minor changes in one function, and not inside any loop, so the regression is mysterious.

In general, I could imagine regressions due to several possibilities:
a. Denser branches. I've seen writing that multiple branches in a 16-byte section incur a small penalty compared to less dense branches.
b. NOP compensation: Some branches should be short, but end up being estimated as long plus 4 bytes of "NOP compensation" due to the implementation of loop alignment "shrinking" that happens after branch shortening. Note that the newly introduced branches always branch over inner loops that are likely to be aligned.
c. With more branches, we are more likely to hit the Intel jcc erratum slowdown.

@BruceForstall BruceForstall force-pushed the CloneConditionsInMultipleBlocks branch from 91fa5eb to f1091c8 Compare October 7, 2021 00:46
@BruceForstall BruceForstall marked this pull request as ready for review October 7, 2021 00:47
@BruceForstall
Copy link
Contributor Author

@AndyAyersMS @dotnet/jit-contrib PTAL

@BruceForstall
Copy link
Contributor Author

Sample diffs:

Baseline:

mov      edx, eax
not      edx
shr      edx, 31
mov      r8d, r11d
not      r8d
shr      r8d, 31
and      edx, r8d
cmp      esi, r11d
setge    r8b
movzx    r8, r8b
test     edx, r8d
je       SHORT G_M64169_IG09

Diff:

test     eax, eax
jl       SHORT G_M64169_IG09
test     r11d, r11d
jl       SHORT G_M64169_IG09
cmp      esi, r11d
jl       SHORT G_M64169_IG09

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

What's below are some random ideas for follow-up.

How complicated do these things get? I wonder, since we generally expect that all these predicates evaluate true, for cases where we have > 3 conditions if building a somewhat-balanced tree of ANDs might have worked out better and have shorter critical path overall, eg

AND(AND(p1,p2),AND(p3,p4))

instead of

AND(AND(AND(AND(p1, p2), p3), p4)

But it still might lose out to the branch form, assuming the branches are highly predictable (which they should be).

Also if there can be indirs in these trees I wonder if "scheduling" the order might help any.

@BruceForstall
Copy link
Contributor Author

The bitwise-and code could be improved in another way (at least on 64-bit / x64). Here's a case:

       test     rbx, rbx
       setne    al
       movzx    rax, al
       test     rsi, rsi
       setne    dl
       movzx    rdx, dl
       and      eax, edx
       test     rdi, rdi
       setne    dl
       movzx    rdx, dl
       test     eax, edx
       je       G_M19663_IG11

We could get rid of all the movzx and keep all registers as byte only, but the JIT doesn't really like to think about byte sized things. e.g.:

       test     rbx, rbx
       setne    al
       test     rsi, rsi
       setne    dl
       and      al, dl
       test     rdi, rdi
       setne    dl
       test     al, dl
       je       G_M19663_IG11

@BruceForstall BruceForstall merged commit fd69468 into dotnet:main Oct 7, 2021
@BruceForstall BruceForstall deleted the CloneConditionsInMultipleBlocks branch October 7, 2021 05:26
@ghost ghost locked as resolved and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants