Skip to content

Conversation

@BruceForstall
Copy link
Contributor

Loop cloning currently only handles loops using < limit comparison,
e.g., in loops like for (i = c; i < n; i++). This change allows
for loop cloning for loops using <=. This happens frequently in the BenchF
benchmarks (which maybe had their origin long ago in 1-based array Fortran code?),
and some in the BenchI benchmarks. In real world code, it happens
in Visual Basic code.

There are perf wins and losses, with the usual existing issues for loop cloning.
For one case, BenchI.XPosMatrix, I see a loss due to various things, including:

  1. Unfortunate register allocation and/or missing copy prop, leading to lots of
    unnecessary copies.
  2. Hitting jcc erratum
  3. CSE leads to un-contained array length load in array bounds check

Even so, there is one fewer bounds check than the baseline. We could remove one more,
but a limitation in recognizing multi-dimensional jagged array components prevents loop
cloning from recognizing a legal-to-remove bounds check (#54074).

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

ghost commented Oct 7, 2021

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

Issue Details

Loop cloning currently only handles loops using < limit comparison,
e.g., in loops like for (i = c; i < n; i++). This change allows
for loop cloning for loops using <=. This happens frequently in the BenchF
benchmarks (which maybe had their origin long ago in 1-based array Fortran code?),
and some in the BenchI benchmarks. In real world code, it happens
in Visual Basic code.

There are perf wins and losses, with the usual existing issues for loop cloning.
For one case, BenchI.XPosMatrix, I see a loss due to various things, including:

  1. Unfortunate register allocation and/or missing copy prop, leading to lots of
    unnecessary copies.
  2. Hitting jcc erratum
  3. CSE leads to un-contained array length load in array bounds check

Even so, there is one fewer bounds check than the baseline. We could remove one more,
but a limitation in recognizing multi-dimensional jagged array components prevents loop
cloning from recognizing a legal-to-remove bounds check (#54074).

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Contributor Author

Diffs are a code size regression, because loop cloning kicks in more, which is code expanding.

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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 14359
Total bytes of diff: 17586
Total bytes of delta: 3227 (22.47% of base)
Total relative delta: 10.92
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
         912 : 25996.dasm (137.56% of base)
         502 : 14523.dasm (232.41% of base)
         334 : 12938.dasm (38.08% of base)
         265 : 12444.dasm (194.85% of base)
         252 : 26351.dasm (3.01% of base)
         210 : 24816.dasm (66.04% of base)
         168 : 23257.dasm (163.11% of base)
         143 : 7370.dasm (44.83% of base)
         112 : 11814.dasm (64.74% of base)
          91 : 20924.dasm (64.08% of base)
          67 : 12434.dasm (5.42% of base)
          53 : 11806.dasm (5.73% of base)
          47 : 26356.dasm (16.43% of base)
          34 : 11813.dasm (28.81% of base)
          23 : 23657.dasm (14.56% of base)
          14 : 7369.dasm (12.50% of base)

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

Top method regressions (bytes):
         912 (137.56% of base) : 25996.dasm - Benchstone.BenchF.InvMt:Test():bool:this
         502 (232.41% of base) : 14523.dasm - Benchstone.BenchF.SqMtx:Inner(System.Double[][],System.Double[][],int)
         334 (38.08% of base) : 12938.dasm - Benchstone.BenchF.Romber:Test():bool:this
         265 (194.85% of base) : 12444.dasm - Benchstone.BenchI.XposMatrix:Inner(System.Int32[][],int)
         252 ( 3.01% of base) : 26351.dasm - Benchstone.BenchF.LLoops:Main1(int):this
         210 (66.04% of base) : 24816.dasm - Benchstone.BenchI.Midpoint:Test():bool:this
         168 (163.11% of base) : 23257.dasm - Benchstone.BenchI.BubbleSort2:Inner(System.Int32[])
         143 (44.83% of base) : 7370.dasm - Benchstone.BenchI.HeapSort:Inner(System.Int32[],int)
         112 (64.74% of base) : 11814.dasm - Benchstone.BenchI.TreeSort:InitArray(System.Int32[])
          91 (64.08% of base) : 20924.dasm - Benchstone.BenchI.AddArray2:BenchInner2(System.Int32[][],byref)
          67 ( 5.42% of base) : 12434.dasm - BenchmarksGame.FannkuchRedux_5:run(int,int,int)
          53 ( 5.73% of base) : 11806.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]:this
          47 (16.43% of base) : 26356.dasm - Benchstone.BenchI.Pi:ComputePi(System.Int32[]):System.Int32[]
          34 (28.81% of base) : 11813.dasm - Benchstone.BenchI.TreeSort:Trees(System.Int32[]):bool
          23 (14.56% of base) : 23657.dasm - Benchstone.BenchI.CSieve:Test():bool:this
          14 (12.50% of base) : 7369.dasm - Benchstone.BenchI.HeapSort:Test():bool:this

Top method regressions (percentages):
         502 (232.41% of base) : 14523.dasm - Benchstone.BenchF.SqMtx:Inner(System.Double[][],System.Double[][],int)
         265 (194.85% of base) : 12444.dasm - Benchstone.BenchI.XposMatrix:Inner(System.Int32[][],int)
         168 (163.11% of base) : 23257.dasm - Benchstone.BenchI.BubbleSort2:Inner(System.Int32[])
         912 (137.56% of base) : 25996.dasm - Benchstone.BenchF.InvMt:Test():bool:this
         210 (66.04% of base) : 24816.dasm - Benchstone.BenchI.Midpoint:Test():bool:this
         112 (64.74% of base) : 11814.dasm - Benchstone.BenchI.TreeSort:InitArray(System.Int32[])
          91 (64.08% of base) : 20924.dasm - Benchstone.BenchI.AddArray2:BenchInner2(System.Int32[][],byref)
         143 (44.83% of base) : 7370.dasm - Benchstone.BenchI.HeapSort:Inner(System.Int32[],int)
         334 (38.08% of base) : 12938.dasm - Benchstone.BenchF.Romber:Test():bool:this
          34 (28.81% of base) : 11813.dasm - Benchstone.BenchI.TreeSort:Trees(System.Int32[]):bool
          47 (16.43% of base) : 26356.dasm - Benchstone.BenchI.Pi:ComputePi(System.Int32[]):System.Int32[]
          23 (14.56% of base) : 23657.dasm - Benchstone.BenchI.CSieve:Test():bool:this
          14 (12.50% of base) : 7369.dasm - Benchstone.BenchI.HeapSort:Test():bool:this
          53 ( 5.73% of base) : 11806.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]:this
          67 ( 5.42% of base) : 12434.dasm - BenchmarksGame.FannkuchRedux_5:run(int,int,int)
         252 ( 3.01% of base) : 26351.dasm - Benchstone.BenchF.LLoops:Main1(int):this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 22749
Total bytes of diff: 26406
Total bytes of delta: 3657 (16.08% of base)
Total relative delta: 11.45
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
         912 : 229069.dasm (137.56% of base)
         502 : 231310.dasm (232.41% of base)
         315 : 229060.dasm (39.57% of base)
         279 : 209725.dasm (3.32% of base)
         265 : 231376.dasm (194.85% of base)
         206 : 231375.dasm (69.36% of base)
         186 : 234146.dasm (22.52% of base)
         152 : 231333.dasm (168.89% of base)
         143 : 231331.dasm (44.83% of base)
         142 : 163748.dasm (2.75% of base)
         112 : 229111.dasm (64.74% of base)
          91 : 229129.dasm (64.08% of base)
          67 : 221812.dasm (24.19% of base)
          67 : 221815.dasm (5.42% of base)
          53 : 229034.dasm (5.73% of base)
          47 : 231364.dasm (16.43% of base)
          41 : 176841.dasm (2.17% of base)
          34 : 229113.dasm (28.81% of base)
          22 : 85739.dasm (9.48% of base)
          19 : 231371.dasm (15.08% of base)

Top file improvements (bytes):
          -6 : 211487.dasm (-9.84% of base)
          -6 : 211509.dasm (-9.84% of base)

23 total files with Code Size differences (2 improved, 21 regressed), 1 unchanged.

Top method regressions (bytes):
         912 (137.56% of base) : 229069.dasm - Benchstone.BenchF.InvMt:Bench():bool
         502 (232.41% of base) : 231310.dasm - Benchstone.BenchF.SqMtx:Inner(System.Double[][],System.Double[][],int)
         315 (39.57% of base) : 229060.dasm - Benchstone.BenchF.Romber:Bench():bool
         279 ( 3.32% of base) : 209725.dasm - Benchstone.BenchF.LLoops:Main1(int):this
         265 (194.85% of base) : 231376.dasm - Benchstone.BenchI.XposMatrix:Inner(System.Int32[][],int)
         206 (69.36% of base) : 231375.dasm - Benchstone.BenchI.Midpoint:Bench():bool
         186 (22.52% of base) : 234146.dasm - CTest:TestArrays1(int,double)
         152 (168.89% of base) : 231333.dasm - Benchstone.BenchI.BubbleSort2:Inner(System.Int32[])
         143 (44.83% of base) : 231331.dasm - Benchstone.BenchI.HeapSort:Inner(System.Int32[],int)
         142 ( 2.75% of base) : 163748.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeAutoFieldLayout(Internal.TypeSystem.MetadataType,int):Internal.TypeSystem.ComputedInstanceFieldLayout:this
         112 (64.74% of base) : 229111.dasm - Benchstone.BenchI.TreeSort:InitArray(System.Int32[])
          91 (64.08% of base) : 229129.dasm - Benchstone.BenchI.AddArray2:BenchInner2(System.Int32[][],byref)
          67 (24.19% of base) : 221812.dasm - BenchmarksGame.FannkuchRedux_5:firstPermutation(System.Int32[],System.Int32[],System.Int32[],int)
          67 ( 5.42% of base) : 221815.dasm - BenchmarksGame.FannkuchRedux_5:run(int,int,int)
          53 ( 5.73% of base) : 229034.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]
          47 (16.43% of base) : 231364.dasm - Benchstone.BenchI.Pi:ComputePi(System.Int32[]):System.Int32[]
          41 ( 2.17% of base) : 176841.dasm - Huffman:DoHuffIteration(System.Byte[],System.Byte[],System.Byte[],int,int,huff_node[]):long
          34 (28.81% of base) : 229113.dasm - Benchstone.BenchI.TreeSort:Trees(System.Int32[]):bool
          22 ( 9.48% of base) : 85739.dasm - QSortTest.Sorter:Main():int
          19 (15.08% of base) : 231371.dasm - Benchstone.BenchI.CSieve:Bench():bool

Top method improvements (bytes):
          -6 (-9.84% of base) : 211487.dasm - test:test_022b()
          -6 (-9.84% of base) : 211509.dasm - test:test_002b()

Top method regressions (percentages):
         502 (232.41% of base) : 231310.dasm - Benchstone.BenchF.SqMtx:Inner(System.Double[][],System.Double[][],int)
         265 (194.85% of base) : 231376.dasm - Benchstone.BenchI.XposMatrix:Inner(System.Int32[][],int)
         152 (168.89% of base) : 231333.dasm - Benchstone.BenchI.BubbleSort2:Inner(System.Int32[])
         912 (137.56% of base) : 229069.dasm - Benchstone.BenchF.InvMt:Bench():bool
         206 (69.36% of base) : 231375.dasm - Benchstone.BenchI.Midpoint:Bench():bool
         112 (64.74% of base) : 229111.dasm - Benchstone.BenchI.TreeSort:InitArray(System.Int32[])
          91 (64.08% of base) : 229129.dasm - Benchstone.BenchI.AddArray2:BenchInner2(System.Int32[][],byref)
         143 (44.83% of base) : 231331.dasm - Benchstone.BenchI.HeapSort:Inner(System.Int32[],int)
         315 (39.57% of base) : 229060.dasm - Benchstone.BenchF.Romber:Bench():bool
          34 (28.81% of base) : 229113.dasm - Benchstone.BenchI.TreeSort:Trees(System.Int32[]):bool
          67 (24.19% of base) : 221812.dasm - BenchmarksGame.FannkuchRedux_5:firstPermutation(System.Int32[],System.Int32[],System.Int32[],int)
         186 (22.52% of base) : 234146.dasm - CTest:TestArrays1(int,double)
          47 (16.43% of base) : 231364.dasm - Benchstone.BenchI.Pi:ComputePi(System.Int32[]):System.Int32[]
          19 (15.08% of base) : 231371.dasm - Benchstone.BenchI.CSieve:Bench():bool
          14 (12.50% of base) : 231332.dasm - Benchstone.BenchI.HeapSort:Bench():bool
          22 ( 9.48% of base) : 85739.dasm - QSortTest.Sorter:Main():int
          53 ( 5.73% of base) : 229034.dasm - BenchmarksGame.FannkuchRedux_2:fannkuch(int):System.Int32[]
          67 ( 5.42% of base) : 221815.dasm - BenchmarksGame.FannkuchRedux_5:run(int,int,int)
         279 ( 3.32% of base) : 209725.dasm - Benchstone.BenchF.LLoops:Main1(int):this
         142 ( 2.75% of base) : 163748.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeAutoFieldLayout(Internal.TypeSystem.MetadataType,int):Internal.TypeSystem.ComputedInstanceFieldLayout:this

Top method improvements (percentages):
          -6 (-9.84% of base) : 211487.dasm - test:test_022b()
          -6 (-9.84% of base) : 211509.dasm - test:test_002b()

23 total methods with Code Size differences (2 improved, 21 regressed), 1 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 105602
Total bytes of diff: 143745
Total bytes of delta: 38143 (36.12% of base)
Total relative delta: 44.53
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
       12252 : 23415.dasm (89.88% of base)
        2175 : 23402.dasm (121.51% of base)
        2160 : 23413.dasm (69.08% of base)
        1277 : 23497.dasm (90.18% of base)
        1054 : 23409.dasm (92.95% of base)
        1040 : 23500.dasm (86.38% of base)
         841 : 87162.dasm (64.79% of base)
         734 : 23407.dasm (86.15% of base)
         513 : 94415.dasm (31.36% of base)
         500 : 23667.dasm (77.88% of base)
         484 : 23405.dasm (52.72% of base)
         443 : 77277.dasm (11.28% of base)
         388 : 70871.dasm (22.10% of base)
         351 : 24136.dasm (100.29% of base)
         335 : 94213.dasm (18.59% of base)
         334 : 94061.dasm (35.80% of base)
         322 : 52469.dasm (74.36% of base)
         312 : 23411.dasm (59.20% of base)
         307 : 23817.dasm (73.44% of base)
         279 : 23412.dasm (77.93% of base)

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

Top method regressions (bytes):
       12252 (89.88% of base) : 23415.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:BindToMethod(int,System.Reflection.MethodBase[],byref,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],byref):System.Reflection.MethodBase:this
        2175 (121.51% of base) : 23402.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:GetMethodsByName(System.Type,System.Reflection.IReflect,System.String,int):System.Reflection.MethodBase[]:this
        2160 (69.08% of base) : 23413.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:GetMostSpecific(System.Reflection.MethodBase,System.Reflection.MethodBase,System.Int32[],System.Object[],bool,int,int,System.Object[]):int:this
        1277 (90.18% of base) : 23497.dasm - Microsoft.VisualBasic.CompilerServices.VB6File:InternalWriteHelper(System.Object[]):this
        1054 (92.95% of base) : 23409.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:SelectProperty(int,System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo:this
        1040 (86.38% of base) : 23500.dasm - Microsoft.VisualBasic.CompilerServices.VB6File:Print(System.Object[]):this
         841 (64.79% of base) : 87162.dasm - Microsoft.CodeAnalysis.VisualBasic.UseTwiceRewriter:UseTwiceLateInvocation(Microsoft.CodeAnalysis.VisualBasic.Symbol,Microsoft.CodeAnalysis.VisualBasic.BoundLateInvocation,Microsoft.CodeAnalysis.ArrayBuilder`1[Microsoft.CodeAnalysis.VisualBasic.Symbols.SynthesizedLocal]):Microsoft.CodeAnalysis.VisualBasic.UseTwiceRewriter+Result
         734 (86.15% of base) : 23407.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:BindingScore(System.Reflection.ParameterInfo[],System.Int32[],System.Type[],bool,int):int:this
         513 (31.36% of base) : 94415.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:BindDelegateCreationExpression(Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol,Microsoft.CodeAnalysis.VisualBasic.Syntax.ArgumentListSyntax,Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.DiagnosticBag):Microsoft.CodeAnalysis.VisualBasic.BoundExpression:this
         500 (77.88% of base) : 23667.dasm - Container:FilterInvalidMembers(System.Reflection.MemberInfo[]):System.Reflection.MemberInfo[]
         484 (52.72% of base) : 23405.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:CreateParamOrder(bool,System.Int32[],System.Reflection.ParameterInfo[],System.Object[],System.String[]):System.Exception:this
         443 (11.28% of base) : 77277.dasm - Microsoft.CodeAnalysis.VisualBasic.OverloadResolution:MatchArguments(Microsoft.CodeAnalysis.VisualBasic.BoundMethodOrPropertyGroup,byref,System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.VisualBasic.BoundExpression],System.Collections.Immutable.ImmutableArray`1[System.String],Microsoft.CodeAnalysis.VisualBasic.Binder,byref,Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,bool,byref)
         388 (22.10% of base) : 70871.dasm - InferenceGraph:Infer(Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.VisualBasic.BoundExpression],Microsoft.CodeAnalysis.ArrayBuilder`1[System.Int32],Microsoft.CodeAnalysis.ArrayBuilder`1[System.Int32],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol,Microsoft.CodeAnalysis.VisualBasic.BoundNode,byref,byref,byref,byref,byref,byref,byref,byref,byref,byref,Microsoft.CodeAnalysis.BitVector):bool
         351 (100.29% of base) : 24136.dasm - Microsoft.VisualBasic.CompilerServices.LateBinding:MemberIsField(System.Reflection.MemberInfo[]):bool
         335 (18.59% of base) : 94213.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:BindLambdaForErrorRecovery(Microsoft.CodeAnalysis.VisualBasic.UnboundLambda):Microsoft.CodeAnalysis.VisualBasic.BoundLambda:this
         334 (35.80% of base) : 94061.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:BindBlock(Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.SyntaxList`1[Microsoft.CodeAnalysis.VisualBasic.Syntax.StatementSyntax],Microsoft.CodeAnalysis.DiagnosticBag,Microsoft.CodeAnalysis.VisualBasic.Binder):Microsoft.CodeAnalysis.VisualBasic.BoundBlock:this
         322 (74.36% of base) : 52469.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
         312 (59.20% of base) : 23411.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:MethodsDifferOnlyByReturnType(System.Reflection.MethodBase,System.Reflection.MethodBase):bool:this
         307 (73.44% of base) : 23817.dasm - Microsoft.VisualBasic.CompilerServices.OverloadResolution:IsExactSignatureMatch(System.Reflection.ParameterInfo[],int,System.Reflection.ParameterInfo[],int):bool
         279 (77.93% of base) : 23412.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:MatchesParamArraySignature(System.Reflection.ParameterInfo[],System.Reflection.ParameterInfo[],int,bool,int):bool:this

Top method regressions (percentages):
        2175 (121.51% of base) : 23402.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:GetMethodsByName(System.Type,System.Reflection.IReflect,System.String,int):System.Reflection.MethodBase[]:this
         351 (100.29% of base) : 24136.dasm - Microsoft.VisualBasic.CompilerServices.LateBinding:MemberIsField(System.Reflection.MemberInfo[]):bool
         263 (98.87% of base) : 81288.dasm - Microsoft.CodeAnalysis.VisualBasic.Syntax.KeywordTable:EnsureHalfWidth(System.String):System.String
          65 (94.20% of base) : 195978.dasm - ReplaceEscapeSequenceRule:HexToInt32(System.Char[]):int
        1054 (92.95% of base) : 23409.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:SelectProperty(int,System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo:this
        1277 (90.18% of base) : 23497.dasm - Microsoft.VisualBasic.CompilerServices.VB6File:InternalWriteHelper(System.Object[]):this
       12252 (89.88% of base) : 23415.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:BindToMethod(int,System.Reflection.MethodBase[],byref,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],byref):System.Reflection.MethodBase:this
        1040 (86.38% of base) : 23500.dasm - Microsoft.VisualBasic.CompilerServices.VB6File:Print(System.Object[]):this
         734 (86.15% of base) : 23407.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:BindingScore(System.Reflection.ParameterInfo[],System.Int32[],System.Type[],bool,int):int:this
         197 (79.76% of base) : 77717.dasm - Microsoft.CodeAnalysis.VisualBasic.SyntaxFacts:MakeHalfWidthIdentifier(System.String):System.String
         279 (77.93% of base) : 23412.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:MatchesParamArraySignature(System.Reflection.ParameterInfo[],System.Reflection.ParameterInfo[],int,bool,int):bool:this
         500 (77.88% of base) : 23667.dasm - Container:FilterInvalidMembers(System.Reflection.MemberInfo[]):System.Reflection.MemberInfo[]
         322 (74.36% of base) : 52469.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
         307 (73.44% of base) : 23817.dasm - Microsoft.VisualBasic.CompilerServices.OverloadResolution:IsExactSignatureMatch(System.Reflection.ParameterInfo[],int,System.Reflection.ParameterInfo[],int):bool
        2160 (69.08% of base) : 23413.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:GetMostSpecific(System.Reflection.MethodBase,System.Reflection.MethodBase,System.Int32[],System.Object[],bool,int,int,System.Object[]):int:this
         841 (64.79% of base) : 87162.dasm - Microsoft.CodeAnalysis.VisualBasic.UseTwiceRewriter:UseTwiceLateInvocation(Microsoft.CodeAnalysis.VisualBasic.Symbol,Microsoft.CodeAnalysis.VisualBasic.BoundLateInvocation,Microsoft.CodeAnalysis.ArrayBuilder`1[Microsoft.CodeAnalysis.VisualBasic.Symbols.SynthesizedLocal]):Microsoft.CodeAnalysis.VisualBasic.UseTwiceRewriter+Result
          78 (62.40% of base) : 80614.dasm - Microsoft.CodeAnalysis.VisualBasic.Syntax.SyntaxListBuilder:ToGreenArray():Microsoft.CodeAnalysis.ArrayElement`1[Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax.VisualBasicSyntaxNode][]:this
         218 (61.93% of base) : 73287.dasm - TypeBinder:BindTypeArguments(Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeArgumentListSyntax,Microsoft.CodeAnalysis.VisualBasic.Binder,Microsoft.CodeAnalysis.DiagnosticBag,bool):System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol]
         312 (59.20% of base) : 23411.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:MethodsDifferOnlyByReturnType(System.Reflection.MethodBase,System.Reflection.MethodBase):bool:this
         191 (59.13% of base) : 93744.dasm - Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder:BingTypeArgumentsForCref(Microsoft.CodeAnalysis.SeparatedSyntaxList`1[Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeSyntax]):System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol]:this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 282365
Total bytes of diff: 385751
Total bytes of delta: 103386 (36.61% of base)
Total relative delta: 89.92
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
       10891 : 104656.dasm (78.57% of base)
        8108 : 49958.dasm (212.31% of base)
        6576 : 49933.dasm (38.52% of base)
        2652 : 49930.dasm (84.59% of base)
        2411 : 52733.dasm (91.36% of base)
        2228 : 49897.dasm (51.50% of base)
        2155 : 104658.dasm (59.65% of base)
        2074 : 55179.dasm (99.66% of base)
        1889 : 56946.dasm (93.84% of base)
        1795 : 52735.dasm (100.56% of base)
        1794 : 73784.dasm (92.47% of base)
        1787 : 56872.dasm (52.81% of base)
        1722 : 56819.dasm (33.05% of base)
        1682 : 72651.dasm (38.73% of base)
        1571 : 50123.dasm (20.39% of base)
        1553 : 72701.dasm (41.01% of base)
        1516 : 52464.dasm (98.70% of base)
        1426 : 55176.dasm (100.64% of base)
        1399 : 56228.dasm (83.22% of base)
        1313 : 54776.dasm (69.91% of base)

Top file improvements (bytes):
          -9 : 57192.dasm (-2.47% of base)
          -7 : 75111.dasm (-1.93% of base)
          -7 : 75071.dasm (-2.15% of base)
          -5 : 49661.dasm (-0.73% of base)
          -5 : 191927.dasm (-1.63% of base)

232 total files with Code Size differences (5 improved, 227 regressed), 0 unchanged.

Top method regressions (bytes):
       10891 (78.57% of base) : 104656.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:BindToMethod(int,System.Reflection.MethodBase[],byref,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],byref):System.Reflection.MethodBase:this
        8108 (212.31% of base) : 49958.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:BindFieldAndPropertyInitializers(Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceMemberContainerTypeSymbol,System.Collections.Immutable.ImmutableArray`1[ImmutableArray`1],Microsoft.CodeAnalysis.VisualBasic.Symbols.SynthesizedInteractiveInitializerMethod,Microsoft.CodeAnalysis.DiagnosticBag):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundInitializer, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]
        6576 (38.52% of base) : 49933.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:ReportOverloadResolutionFailureForASingleCandidate(Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.Location,int,byref,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],bool,bool,bool,bool,Microsoft.CodeAnalysis.DiagnosticBag,Microsoft.CodeAnalysis.VisualBasic.Symbol,bool,Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.VisualBasic.Symbol):this
        2652 (84.59% of base) : 49930.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:ReportUnspecificProcedures(Microsoft.CodeAnalysis.Location,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.DiagnosticBag,bool):this
        2411 (91.36% of base) : 52733.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSignatureComparer:DetailedParameterCompare(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],byref,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],byref,int,int):int
        2228 (51.50% of base) : 49897.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:BindLateBoundInvocation(Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.VisualBasic.BoundMethodOrPropertyGroup,Microsoft.CodeAnalysis.VisualBasic.BoundExpression,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],Microsoft.CodeAnalysis.DiagnosticBag,bool):Microsoft.CodeAnalysis.VisualBasic.BoundExpression:this
        2155 (59.65% of base) : 104658.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:GetMostSpecific(System.Reflection.MethodBase,System.Reflection.MethodBase,System.Int32[],System.Object[],bool,int,int,System.Object[]):int:this
        2074 (99.66% of base) : 55179.dasm - Microsoft.CodeAnalysis.VisualBasic.CodeGen.CodeGenerator:EmitAllElementInitializersRecursive(Microsoft.CodeAnalysis.VisualBasic.Symbols.ArrayTypeSymbol,Microsoft.CodeAnalysis.ArrayBuilder`1[IndexDesc],bool):this
        1889 (93.84% of base) : 56946.dasm - Microsoft.CodeAnalysis.VisualBasic.LocalRewriter:VisitAsNewLocalDeclarations(Microsoft.CodeAnalysis.VisualBasic.BoundAsNewLocalDeclarations):Microsoft.CodeAnalysis.VisualBasic.BoundNode:this
        1795 (100.56% of base) : 52735.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSignatureComparer:HaveSameParameterTypes(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution,bool,bool):bool
        1794 (92.47% of base) : 73784.dasm - AsyncMethodToClassRewriter:RewriteSpillSequenceIntoBlock(Microsoft.CodeAnalysis.VisualBasic.BoundSpillSequence,bool,Microsoft.CodeAnalysis.VisualBasic.BoundStatement[]):Microsoft.CodeAnalysis.VisualBasic.BoundBlock:this
        1787 (52.81% of base) : 56872.dasm - Microsoft.CodeAnalysis.VisualBasic.LocalRewriter:LateMakeArgumentArrayArgument(Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol):Microsoft.CodeAnalysis.VisualBasic.BoundExpression:this
        1722 (33.05% of base) : 56819.dasm - Microsoft.CodeAnalysis.VisualBasic.LocalRewriter:LateCallOrGet(Microsoft.CodeAnalysis.VisualBasic.BoundLateMemberAccess,Microsoft.CodeAnalysis.VisualBasic.BoundExpression,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],bool):Microsoft.CodeAnalysis.VisualBasic.BoundExpression:this
        1682 (38.73% of base) : 72651.dasm - AnonymousDelegatePublicSymbol:.ctor(Microsoft.CodeAnalysis.VisualBasic.Symbols.AnonymousTypeManager,Microsoft.CodeAnalysis.VisualBasic.Symbols.AnonymousTypeDescriptor):this
        1571 (20.39% of base) : 50123.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:MakeVarianceConversionSuggestion(int,Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol,Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol,Microsoft.CodeAnalysis.DiagnosticBag,bool):bool:this
        1553 (41.01% of base) : 72701.dasm - AnonymousDelegateTemplateSymbol:.ctor(Microsoft.CodeAnalysis.VisualBasic.Symbols.AnonymousTypeManager,Microsoft.CodeAnalysis.VisualBasic.Symbols.AnonymousTypeDescriptor):this
        1516 (98.70% of base) : 52464.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceAttributeData:GetTargetAttributeSignatureIndex(Microsoft.CodeAnalysis.VisualBasic.Symbol,Microsoft.CodeAnalysis.AttributeDescription):int:this
        1426 (100.64% of base) : 55176.dasm - Microsoft.CodeAnalysis.VisualBasic.CodeGen.CodeGenerator:EmitOnedimensionalElementInitializers(Microsoft.CodeAnalysis.VisualBasic.Symbols.ArrayTypeSymbol,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],bool):this
        1399 (83.22% of base) : 56228.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbol:GetAttributesToBind(Roslyn.Utilities.OneOrMany`1[[Microsoft.CodeAnalysis.SyntaxList`1[[Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeListSyntax, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.CodeAnalysis, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],int,Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation,byref):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeSyntax, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
        1313 (69.91% of base) : 54776.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution:PrivateAdjustForConstruct(Microsoft.CodeAnalysis.ArrayBuilder`1[[System.Collections.Generic.KeyValuePair`2[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeWithModifiers, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution,Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution):bool

Top method improvements (bytes):
          -9 (-2.47% of base) : 57192.dasm - Microsoft.CodeAnalysis.VisualBasic.SynthesizedStateMachineMethod:.ctor(Microsoft.CodeAnalysis.VisualBasic.StateMachineTypeSymbol,System.String,Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,int,bool,bool,Microsoft.CodeAnalysis.VisualBasic.Symbols.PropertySymbol):this
          -7 (-1.93% of base) : 75111.dasm - SynthesizedComProperty:.ctor(SynthesizedComInterface,Microsoft.CodeAnalysis.VisualBasic.Symbols.PropertySymbol,SynthesizedComMethod,SynthesizedComMethod,int):this
          -7 (-2.15% of base) : 75071.dasm - SynthesizedComMethod:.ctor(SynthesizedComInterface,Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,int):this
          -5 (-0.73% of base) : 49661.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:ConstructAndValidateConstraints(Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.SeparatedSyntaxList`1[[Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeSyntax, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.DiagnosticBag):Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol:this
          -5 (-1.63% of base) : 191927.dasm - System.IO.Compression.HuffmanTree:CalculateHuffmanCode():System.UInt32[]:this

Top method regressions (percentages):
        8108 (212.31% of base) : 49958.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:BindFieldAndPropertyInitializers(Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceMemberContainerTypeSymbol,System.Collections.Immutable.ImmutableArray`1[ImmutableArray`1],Microsoft.CodeAnalysis.VisualBasic.Symbols.SynthesizedInteractiveInitializerMethod,Microsoft.CodeAnalysis.DiagnosticBag):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundInitializer, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]
         483 (102.99% of base) : 73463.dasm - Analyzer:VisitArguments(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
        1426 (100.64% of base) : 55176.dasm - Microsoft.CodeAnalysis.VisualBasic.CodeGen.CodeGenerator:EmitOnedimensionalElementInitializers(Microsoft.CodeAnalysis.VisualBasic.Symbols.ArrayTypeSymbol,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.BoundExpression, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],bool):this
        1795 (100.56% of base) : 52735.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSignatureComparer:HaveSameParameterTypes(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSubstitution,bool,bool):bool
        2074 (99.66% of base) : 55179.dasm - Microsoft.CodeAnalysis.VisualBasic.CodeGen.CodeGenerator:EmitAllElementInitializersRecursive(Microsoft.CodeAnalysis.VisualBasic.Symbols.ArrayTypeSymbol,Microsoft.CodeAnalysis.ArrayBuilder`1[IndexDesc],bool):this
        1516 (98.70% of base) : 52464.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceAttributeData:GetTargetAttributeSignatureIndex(Microsoft.CodeAnalysis.VisualBasic.Symbol,Microsoft.CodeAnalysis.AttributeDescription):int:this
         266 (95.34% of base) : 63047.dasm - Microsoft.CodeAnalysis.VisualBasic.Syntax.KeywordTable:EnsureHalfWidth(System.String):System.String
         311 (95.11% of base) : 103933.dasm - Microsoft.VisualBasic.CompilerServices.LateBinding:MemberIsField(System.Reflection.MemberInfo[]):bool
          65 (94.20% of base) : 231402.dasm - ReplaceEscapeSequenceRule:HexToInt32(System.Char[]):int
        1022 (93.93% of base) : 104663.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:SelectProperty(int,System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo:this
        1889 (93.84% of base) : 56946.dasm - Microsoft.CodeAnalysis.VisualBasic.LocalRewriter:VisitAsNewLocalDeclarations(Microsoft.CodeAnalysis.VisualBasic.BoundAsNewLocalDeclarations):Microsoft.CodeAnalysis.VisualBasic.BoundNode:this
        1794 (92.47% of base) : 73784.dasm - AsyncMethodToClassRewriter:RewriteSpillSequenceIntoBlock(Microsoft.CodeAnalysis.VisualBasic.BoundSpillSequence,bool,Microsoft.CodeAnalysis.VisualBasic.BoundStatement[]):Microsoft.CodeAnalysis.VisualBasic.BoundBlock:this
        2411 (91.36% of base) : 52733.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSignatureComparer:DetailedParameterCompare(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],byref,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],byref,int,int):int
         533 (89.88% of base) : 68302.dasm - Microsoft.CodeAnalysis.VisualBasic.Conversions:ClassifyMethodConversionForLambdaOrAnonymousDelegateBasedOnParameters(TargetSignature,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],byref):int
         337 (88.92% of base) : 126344.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
         695 (86.55% of base) : 53900.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceNamedTypeSymbol:MakeTypeParameters():System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
        2652 (84.59% of base) : 49930.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:ReportUnspecificProcedures(Microsoft.CodeAnalysis.Location,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.DiagnosticBag,bool):this
        1399 (83.22% of base) : 56228.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbol:GetAttributesToBind(Roslyn.Utilities.OneOrMany`1[[Microsoft.CodeAnalysis.SyntaxList`1[[Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeListSyntax, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.CodeAnalysis, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],int,Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation,byref):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeSyntax, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
         336 (82.76% of base) : 104659.dasm - Microsoft.VisualBasic.CompilerServices.VBBinder:MatchesParamArraySignature(System.Reflection.ParameterInfo[],System.Reflection.ParameterInfo[],int,bool,int):bool:this
         352 (79.64% of base) : 73424.dasm - Analyzer:VisitArrayInitialization(Microsoft.CodeAnalysis.VisualBasic.BoundArrayInitialization):Microsoft.CodeAnalysis.VisualBasic.BoundNode:this

Top method improvements (percentages):
          -9 (-2.47% of base) : 57192.dasm - Microsoft.CodeAnalysis.VisualBasic.SynthesizedStateMachineMethod:.ctor(Microsoft.CodeAnalysis.VisualBasic.StateMachineTypeSymbol,System.String,Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,int,bool,bool,Microsoft.CodeAnalysis.VisualBasic.Symbols.PropertySymbol):this
          -7 (-2.15% of base) : 75071.dasm - SynthesizedComMethod:.ctor(SynthesizedComInterface,Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,int):this
          -7 (-1.93% of base) : 75111.dasm - SynthesizedComProperty:.ctor(SynthesizedComInterface,Microsoft.CodeAnalysis.VisualBasic.Symbols.PropertySymbol,SynthesizedComMethod,SynthesizedComMethod,int):this
          -5 (-1.63% of base) : 191927.dasm - System.IO.Compression.HuffmanTree:CalculateHuffmanCode():System.UInt32[]:this
          -5 (-0.73% of base) : 49661.dasm - Microsoft.CodeAnalysis.VisualBasic.Binder:ConstructAndValidateConstraints(Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol,System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode,Microsoft.CodeAnalysis.SeparatedSyntaxList`1[[Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeSyntax, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.DiagnosticBag):Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol:this

232 total methods with Code Size differences (5 improved, 227 regressed), 0 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 9086
Total bytes of diff: 12569
Total bytes of delta: 3483 (38.33% of base)
Total relative delta: 10.31
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
         337 : 180007.dasm (88.92% of base)
         337 : 228083.dasm (88.92% of base)
         262 : 337966.dasm (36.34% of base)
         239 : 4207.dasm (34.09% of base)
         210 : 4210.dasm (36.40% of base)
         210 : 4191.dasm (36.46% of base)
         210 : 4198.dasm (36.46% of base)
         210 : 4204.dasm (34.94% of base)
         210 : 4201.dasm (36.59% of base)
         198 : 4181.dasm (32.84% of base)
         149 : 120559.dasm (47.30% of base)
         149 : 114207.dasm (47.30% of base)
         149 : 243086.dasm (47.30% of base)
         133 : 291535.dasm (45.39% of base)
          56 : 41929.dasm (59.57% of base)
          56 : 40176.dasm (59.57% of base)
          56 : 41910.dasm (59.57% of base)
          56 : 40157.dasm (59.57% of base)
          54 : 42009.dasm (36.99% of base)
          54 : 40256.dasm (36.99% of base)

24 total files with Code Size differences (0 improved, 24 regressed), 0 unchanged.

Top method regressions (bytes):
         337 (88.92% of base) : 180007.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
         337 (88.92% of base) : 228083.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
         262 (36.34% of base) : 337966.dasm - <AddUpdateAndRemoveManyLocals_ReferenceType>d__14:MoveNext():this
         239 (34.09% of base) : 4207.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Vector`1][System.Numerics.Vector`1[System.Single]]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Vector`1],System.Threading.CancellationToken):System.Numerics.Vector`1[Single]
         210 (36.40% of base) : 4210.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Int64][System.Int64]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Int64],System.Threading.CancellationToken):long
         210 (36.46% of base) : 4191.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Byte][System.Byte]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Byte],System.Threading.CancellationToken):ubyte
         210 (36.46% of base) : 4198.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Int16][System.Int16]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Int16],System.Threading.CancellationToken):short
         210 (34.94% of base) : 4204.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Double][System.Double]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Double],System.Threading.CancellationToken):double
         210 (36.59% of base) : 4201.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Int32][System.Int32]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Int32],System.Threading.CancellationToken):int
         198 (32.84% of base) : 4181.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[__Canon][System.__Canon]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[__Canon],System.Threading.CancellationToken):System.__Canon
         149 (47.30% of base) : 120559.dasm - Microsoft.Build.Shared.FileUtilities:PathsEqual(System.String,System.String):bool
         149 (47.30% of base) : 114207.dasm - Microsoft.Build.Shared.FileUtilities:PathsEqual(System.String,System.String):bool
         149 (47.30% of base) : 243086.dasm - Microsoft.Build.Shared.FileUtilities:PathsEqual(System.String,System.String):bool
         133 (45.39% of base) : 291535.dasm - Legacy.Support.TCSupport:OrdinalIndexOf(System.String,int,int,System.String):int
          56 (59.57% of base) : 41929.dasm - System.Globalization.Tests.DateTimeFormatInfoGetMonthName:GetMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          56 (59.57% of base) : 40176.dasm - System.Globalization.Tests.DateTimeFormatInfoGetMonthName:GetMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          56 (59.57% of base) : 41910.dasm - System.Globalization.Tests.DateTimeFormatInfoGetAbbreviatedMonthName:GetAbbreviatedMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          56 (59.57% of base) : 40157.dasm - System.Globalization.Tests.DateTimeFormatInfoGetAbbreviatedMonthName:GetAbbreviatedMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          54 (36.99% of base) : 42009.dasm - System.Globalization.Tests.DateTimeFormatInfoMiscTests:GetShortestDayName_Invoke_ReturnsExpected(System.String):this
          54 (36.99% of base) : 40256.dasm - System.Globalization.Tests.DateTimeFormatInfoMiscTests:GetShortestDayName_Invoke_ReturnsExpected(System.String):this

Top method regressions (percentages):
         337 (88.92% of base) : 180007.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
         337 (88.92% of base) : 228083.dasm - System.Net.Http.HPack.Huffman:GenerateDecodingLookupTree():System.UInt16[]
          56 (59.57% of base) : 41929.dasm - System.Globalization.Tests.DateTimeFormatInfoGetMonthName:GetMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          56 (59.57% of base) : 40176.dasm - System.Globalization.Tests.DateTimeFormatInfoGetMonthName:GetMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          56 (59.57% of base) : 41910.dasm - System.Globalization.Tests.DateTimeFormatInfoGetAbbreviatedMonthName:GetAbbreviatedMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
          56 (59.57% of base) : 40157.dasm - System.Globalization.Tests.DateTimeFormatInfoGetAbbreviatedMonthName:GetAbbreviatedMonthName_Invoke_ReturnsExpected(System.Globalization.DateTimeFormatInfo,System.String[]):this
         149 (47.30% of base) : 120559.dasm - Microsoft.Build.Shared.FileUtilities:PathsEqual(System.String,System.String):bool
         149 (47.30% of base) : 114207.dasm - Microsoft.Build.Shared.FileUtilities:PathsEqual(System.String,System.String):bool
         149 (47.30% of base) : 243086.dasm - Microsoft.Build.Shared.FileUtilities:PathsEqual(System.String,System.String):bool
         133 (45.39% of base) : 291535.dasm - Legacy.Support.TCSupport:OrdinalIndexOf(System.String,int,int,System.String):int
          35 (44.87% of base) : 127126.dasm - Microsoft.CodeAnalysis.VisualBasic.Extensions.SyntaxKindExtensions:IndexOf(Microsoft.CodeAnalysis.VisualBasic.SyntaxKind[],ushort,int):int
          54 (36.99% of base) : 42009.dasm - System.Globalization.Tests.DateTimeFormatInfoMiscTests:GetShortestDayName_Invoke_ReturnsExpected(System.String):this
          54 (36.99% of base) : 40256.dasm - System.Globalization.Tests.DateTimeFormatInfoMiscTests:GetShortestDayName_Invoke_ReturnsExpected(System.String):this
         210 (36.59% of base) : 4201.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Int32][System.Int32]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Int32],System.Threading.CancellationToken):int
         210 (36.46% of base) : 4191.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Byte][System.Byte]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Byte],System.Threading.CancellationToken):ubyte
         210 (36.46% of base) : 4198.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Int16][System.Int16]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Int16],System.Threading.CancellationToken):short
         210 (36.40% of base) : 4210.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Int64][System.Int64]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Int64],System.Threading.CancellationToken):long
         262 (36.34% of base) : 337966.dasm - <AddUpdateAndRemoveManyLocals_ReferenceType>d__14:MoveNext():this
         210 (34.94% of base) : 4204.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Double][System.Double]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Double],System.Threading.CancellationToken):double
         239 (34.09% of base) : 4207.dasm - Microsoft.CodeAnalysis.FlowAnalysis.CustomDataFlowAnalysis`1[Vector`1][System.Numerics.Vector`1[System.Single]]:Run(Microsoft.CodeAnalysis.FlowAnalysis.ControlFlowGraph,Microsoft.CodeAnalysis.FlowAnalysis.DataFlowAnalyzer`1[Vector`1],System.Threading.CancellationToken):System.Numerics.Vector`1[Single]

24 total methods with Code Size differences (0 improved, 24 regressed), 0 unchanged.


@BruceForstall
Copy link
Contributor Author

Note: I did touch the multi-dimensional code path, to make it more like the jagged array path, but multi-dimensional arrays are not supported in loop cloning, so that code isn't currently used.

@BruceForstall
Copy link
Contributor Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BruceForstall
Copy link
Contributor Author

@AndyAyersMS @dotnet/jit-contrib PTAL

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.

LGTM.

Do we have good "negative" tests for cloning -- ones where the fast path conditions are almost but not quite satisfied?

@BruceForstall
Copy link
Contributor Author

Do we have good "negative" tests for cloning -- ones where the fast path conditions are almost but not quite satisfied?

I don't think so. In fact, I'm not sure we have tests where none of the conditions succeed (versus some subset). It's something that should be added.

Copy link
Member

@tannergooding tannergooding Oct 8, 2021

Choose a reason for hiding this comment

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

Do you think some of the other common cases might be this simple? For example limit <= (arrLen - cns) or reverse loops: for (int i = arrLen - 1; i >= 0; i--), or native integer as the tpye for (nuint i = (nuint)(arrLen - 1); i != nuint.MaxValue; i--), etc

Not asking they be handled in this PR or anything; just wondering if they might be "low hanging fruit".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I doubt that other cases would be this simple. However, "count down" loops have been mentioned before as something to consider, and there are plenty of other generalizations that we could look into. This particular generalization came up because I saw it in some benchmarks I was investigating, so I knew there was code out there that would benefit.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. I know we have a couple places in the BCL where we are using ref arithmetic, Unsafe, and other tricks to workaround the other scenarios not working

So supporting them, while not a priority, would allow us to simplify some core perf-critical code and make it more readable/maintainable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened #60188 to track this.

@kasperk81
Copy link
Contributor

Diffs are a code size regression, because loop cloning kicks in more, which is code expanding.

interested in reading about the rationale on why is it a good change despite the 78.57% regression in top case?

@BruceForstall
Copy link
Contributor Author

interested in reading about the rationale on why is it a good change despite the 78.57% regression in top case?

It's a code size regression, not necessarily a run-time regression. Loop cloning literally duplicates the body of a loop, making a "fast path" with fewer bounds checks, and a "slow path" with all the bounds checks. In the best case, the "loop choice conditions" are quick, the "fast path loop" is entered, and the missing bounds checks makes the loop run faster.

Loop cloning currently only handles loops using `<` limit comparison,
e.g., in loops like `for (i = c; i < n; i++)`. This change allows
for loop cloning for loops using `<=`. This happens frequently in the BenchF
benchmarks (which maybe had their origin long ago in 1-based array Fortran code?),
and some in the BenchI benchmarks. In real world code, it happens
in Visual Basic code.

There are perf wins and losses, with the usual existing issues for loop cloning.
For one case, BenchI.XPosMatrix, I see a loss due to various things, including:
1. Unfortunate register allocation and/or missing copy prop, leading to lots of
unnecessary copies.
2. Hitting jcc erratum
3. CSE leads to un-contained array length load in array bounds check

Even so, there is one fewer bounds check than the baseline. We could remove one more,
but a limitation in recognizing multi-dimensional jagged array components prevents loop
cloning from recognizing a legal-to-remove bounds check (dotnet#54074).
This change activated existing unused code that statically determined
a loop choice condition was false, leading to aborting the loop
cloning (and at runtime to an almost certain exception). (The test
case was `for (i = 1; i <= a.Length; i++) { a[i] = 1; }`)

If any choice condition is false, we shouldn't also check if all conditions
are true (that value is unreliable in this case).

There are no SPMI asm diffs from this change.
@BruceForstall BruceForstall force-pushed the SupportCloningLessEqualLoops branch from cda27b2 to f046668 Compare October 8, 2021 06:24
@BruceForstall
Copy link
Contributor Author

/azp run runtime-coreclr outerloop, runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kunalspathak
Copy link
Contributor

arm64 improvements -
image

@kunalspathak
Copy link
Contributor

@DrewScoggins - I am wondering why this one was not flagged by auto filer?

@kasperk81
Copy link
Contributor

x64 regressions graph

@ghost ghost locked as resolved and limited conversation to collaborators Nov 22, 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.

6 participants