Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change loop cloning condition blocks flow graph #59233

Merged

Conversation

BruceForstall
Copy link
Member

Currently, the loop choice condition blocks are created in a way that creates
a confusing flow graph. Restructure them to be simpler, and lay the path for
future work.

The simpler layout (and, hopefully, code and logic to create them) also
lays the groundwork to potentially put the slow path loop in the loop table,
if desired, as it creates a "standard" loop header layout.

While the flow graph has an extra block or two, there are almost no diffs,
as subsequent phases clean up any extras.

There are a few diffs where the new layout enables some downstream optimization
phases that were stymied by the old layout, but mostly in cases where we leave
around dead code slow cloned blocks (a known issue). Also, there are a couple
trivial CSE changes.

Currently, the loop choice condition blocks are created in a way that creates
a confusing flow graph. Restructure them to be simpler, and lay the path for
future work.

The simpler layout (and, hopefully, code and logic to create them) also
lays the groundwork to potentially put the slow path loop in the loop table,
if desired, as it creates a "standard" loop header layout.

While the flow graph has an extra block or two, there are almost no diffs,
as subsequent phases clean up any extras.

There are a few diffs where the new layout enables some downstream optimization
phases that were stymied by the old layout, but mostly in cases where we leave
around dead code slow cloned blocks (a known issue). Also, there are a couple
trivial CSE changes.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 16, 2021
@ghost
Copy link

ghost commented Sep 16, 2021

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

Issue Details

Currently, the loop choice condition blocks are created in a way that creates
a confusing flow graph. Restructure them to be simpler, and lay the path for
future work.

The simpler layout (and, hopefully, code and logic to create them) also
lays the groundwork to potentially put the slow path loop in the loop table,
if desired, as it creates a "standard" loop header layout.

While the flow graph has an extra block or two, there are almost no diffs,
as subsequent phases clean up any extras.

There are a few diffs where the new layout enables some downstream optimization
phases that were stymied by the old layout, but mostly in cases where we leave
around dead code slow cloned blocks (a known issue). Also, there are a couple
trivial CSE changes.

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Member Author

BruceForstall commented Sep 25, 2021

Simple case before / after:

base diff

Note in particular that the "backward" branch from BB04 to BB03 is gone, and the BB03 unconditional branch is gone (although there is a fall-through target after the loop, where the failed conditions all branch).

@BruceForstall
Copy link
Member Author

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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 3522
Total bytes of diff: 3530
Total bytes of delta: 8 (0.23% of base)
Total relative delta: -0.02
    diff is a regression.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          16 : 10898.dasm (1.66% of base)
           7 : 11806.dasm (0.69% of base)
           1 : 9584.dasm (0.27% of base)
           1 : 23298.dasm (0.50% of base)
           1 : 9256.dasm (0.48% of base)

Top file improvements (bytes):
         -14 : 21546.dasm (-5.11% of base)
          -4 : 11153.dasm (-0.80% of base)

7 total files with Code Size differences (2 improved, 5 regressed), 0 unchanged.

Top method regressions (bytes):
          16 ( 1.66% of base) : 10898.dasm - EMFloat:DivideInternalFPF(byref,byref,byref)
           7 ( 0.69% of base) : 11806.dasm - EMFloatClass:DivideInternalFPF(InternalFPF,InternalFPF,InternalFPF)
           1 ( 0.27% of base) : 9584.dasm - Sigil.Impl.LinqAlternative:_Order(System.Collections.Generic.IEnumerable`1[KeyValuePair`2],Sigil.Impl.SigilFunc`2[KeyValuePair`2,Int32],System.Collections.Generic.IComparer`1[Int32]):System.Collections.Generic.IEnumerable`1[KeyValuePair`2]
           1 ( 0.50% of base) : 23298.dasm - Benchstone.BenchI.BubbleSort2:Test():bool:this
           1 ( 0.48% of base) : 9256.dasm - Benchstone.BenchI.QuickSort:Test():bool:this

Top method improvements (bytes):
         -14 (-5.11% of base) : 21546.dasm - Benchstone.BenchI.Array1:Test():bool:this
          -4 (-0.80% of base) : 11153.dasm - MicroBenchmarks.Serializers.DataGenerator:CreateDateTimeArray(int):System.DateTime[]

Top method regressions (percentages):
          16 ( 1.66% of base) : 10898.dasm - EMFloat:DivideInternalFPF(byref,byref,byref)
           7 ( 0.69% of base) : 11806.dasm - EMFloatClass:DivideInternalFPF(InternalFPF,InternalFPF,InternalFPF)
           1 ( 0.50% of base) : 23298.dasm - Benchstone.BenchI.BubbleSort2:Test():bool:this
           1 ( 0.48% of base) : 9256.dasm - Benchstone.BenchI.QuickSort:Test():bool:this
           1 ( 0.27% of base) : 9584.dasm - Sigil.Impl.LinqAlternative:_Order(System.Collections.Generic.IEnumerable`1[KeyValuePair`2],Sigil.Impl.SigilFunc`2[KeyValuePair`2,Int32],System.Collections.Generic.IComparer`1[Int32]):System.Collections.Generic.IEnumerable`1[KeyValuePair`2]

Top method improvements (percentages):
         -14 (-5.11% of base) : 21546.dasm - Benchstone.BenchI.Array1:Test():bool:this
          -4 (-0.80% of base) : 11153.dasm - MicroBenchmarks.Serializers.DataGenerator:CreateDateTimeArray(int):System.DateTime[]

7 total methods with Code Size differences (2 improved, 5 regressed), 0 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 19622
Total bytes of diff: 19916
Total bytes of delta: 294 (1.50% of base)
Total relative delta: 0.25
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
         137 : 232418.dasm (6.81% of base)
          85 : 227928.dasm (6.33% of base)
          34 : 215669.dasm (5.03% of base)
          30 : 218132.dasm (9.12% of base)
          16 : 176861.dasm (1.66% of base)
           7 : 176879.dasm (0.69% of base)
           5 : 226949.dasm (0.70% of base)
           5 : 80636.dasm (0.32% of base)
           4 : 215845.dasm (0.15% of base)
           1 : 227934.dasm (0.10% of base)
           1 : 231312.dasm (0.48% of base)
           1 : 231278.dasm (0.53% of base)

Top file improvements (bytes):
         -14 : 231288.dasm (-5.47% of base)
          -4 : 223766.dasm (-0.40% of base)
          -4 : 223765.dasm (-0.40% of base)
          -4 : 233925.dasm (-0.42% of base)
          -3 : 227165.dasm (-0.18% of base)
          -3 : 227180.dasm (-0.18% of base)

18 total files with Code Size differences (6 improved, 12 regressed), 1 unchanged.

Top method regressions (bytes):
         137 ( 6.81% of base) : 232418.dasm - Complex_Array_Test:Main(System.String[]):int
          85 ( 6.33% of base) : 227928.dasm - JitTest.LCS:findLCS(byref,byref,byref,byref)
          34 ( 5.03% of base) : 215669.dasm - Dynamo.Dynamo:RunTest(int):bool:this
          30 ( 9.12% of base) : 218132.dasm - Test:Main():int
          16 ( 1.66% of base) : 176861.dasm - EMFloat:DivideInternalFPF(byref,byref,byref)
           7 ( 0.69% of base) : 176879.dasm - EMFloatClass:DivideInternalFPF(InternalFPF,InternalFPF,InternalFPF)
           5 ( 0.70% of base) : 226949.dasm - request:Main(System.String[]):int
           5 ( 0.32% of base) : 80636.dasm - JitTest.LCS:findLCS(System.TypedReference,System.TypedReference,System.TypedReference,System.TypedReference)
           4 ( 0.15% of base) : 215845.dasm - MemoryAlloc:SteadyState():this
           1 ( 0.10% of base) : 227934.dasm - JitTest.LCS:findLCS(System.Int32[,,,],System.Int32[,,,],System.Char[][],System.Int32[])
           1 ( 0.48% of base) : 231312.dasm - Benchstone.BenchI.QuickSort:Bench():bool
           1 ( 0.53% of base) : 231278.dasm - Benchstone.BenchI.BubbleSort2:Bench():bool

Top method improvements (bytes):
         -14 (-5.47% of base) : 231288.dasm - Benchstone.BenchI.Array1:Bench():bool
          -4 (-0.40% of base) : 223766.dasm - SimpleArray_01.Test:BadMatrixMul2()
          -4 (-0.40% of base) : 223765.dasm - SimpleArray_01.Test:BadMatrixMul1()
          -4 (-0.42% of base) : 233925.dasm - MatrixMul.Test:MatrixMul()
          -3 (-0.18% of base) : 227165.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int
          -3 (-0.18% of base) : 227180.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int

Top method regressions (percentages):
          30 ( 9.12% of base) : 218132.dasm - Test:Main():int
         137 ( 6.81% of base) : 232418.dasm - Complex_Array_Test:Main(System.String[]):int
          85 ( 6.33% of base) : 227928.dasm - JitTest.LCS:findLCS(byref,byref,byref,byref)
          34 ( 5.03% of base) : 215669.dasm - Dynamo.Dynamo:RunTest(int):bool:this
          16 ( 1.66% of base) : 176861.dasm - EMFloat:DivideInternalFPF(byref,byref,byref)
           5 ( 0.70% of base) : 226949.dasm - request:Main(System.String[]):int
           7 ( 0.69% of base) : 176879.dasm - EMFloatClass:DivideInternalFPF(InternalFPF,InternalFPF,InternalFPF)
           1 ( 0.53% of base) : 231278.dasm - Benchstone.BenchI.BubbleSort2:Bench():bool
           1 ( 0.48% of base) : 231312.dasm - Benchstone.BenchI.QuickSort:Bench():bool
           5 ( 0.32% of base) : 80636.dasm - JitTest.LCS:findLCS(System.TypedReference,System.TypedReference,System.TypedReference,System.TypedReference)
           4 ( 0.15% of base) : 215845.dasm - MemoryAlloc:SteadyState():this
           1 ( 0.10% of base) : 227934.dasm - JitTest.LCS:findLCS(System.Int32[,,,],System.Int32[,,,],System.Char[][],System.Int32[])

Top method improvements (percentages):
         -14 (-5.47% of base) : 231288.dasm - Benchstone.BenchI.Array1:Bench():bool
          -4 (-0.42% of base) : 233925.dasm - MatrixMul.Test:MatrixMul()
          -4 (-0.40% of base) : 223766.dasm - SimpleArray_01.Test:BadMatrixMul2()
          -4 (-0.40% of base) : 223765.dasm - SimpleArray_01.Test:BadMatrixMul1()
          -3 (-0.18% of base) : 227165.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int
          -3 (-0.18% of base) : 227180.dasm - DefaultNamespace.MulDimJagAry:Main(System.String[]):int

18 total methods with Code Size differences (6 improved, 12 regressed), 1 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 2335
Total bytes of diff: 2338
Total bytes of delta: 3 (0.13% of base)
Total relative delta: 0.01
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           8 : 114820.dasm (1.95% of base)

Top file improvements (bytes):
          -5 : 182601.dasm (-0.46% of base)

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

Top method regressions (bytes):
           8 ( 1.95% of base) : 114820.dasm - Microsoft.CodeAnalysis.CSharp.OverloadResolution:NameUsedForPositional(Microsoft.CodeAnalysis.CSharp.AnalyzedArguments,Microsoft.CodeAnalysis.CSharp.OverloadResolution+ParameterMap):System.Nullable`1[System.Int32]

Top method improvements (bytes):
          -5 (-0.46% of base) : 182601.dasm - System.Security.Cryptography.Xml.SymmetricKeyWrap:AESKeyWrapDecrypt(System.Byte[],System.Byte[]):System.Byte[]

Top method regressions (percentages):
           8 ( 1.95% of base) : 114820.dasm - Microsoft.CodeAnalysis.CSharp.OverloadResolution:NameUsedForPositional(Microsoft.CodeAnalysis.CSharp.AnalyzedArguments,Microsoft.CodeAnalysis.CSharp.OverloadResolution+ParameterMap):System.Nullable`1[System.Int32]

Top method improvements (percentages):
          -5 (-0.46% of base) : 182601.dasm - System.Security.Cryptography.Xml.SymmetricKeyWrap:AESKeyWrapDecrypt(System.Byte[],System.Byte[]):System.Byte[]

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 2451
Total bytes of diff: 2459
Total bytes of delta: 8 (0.33% of base)
Total relative delta: 0.01
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           8 : 24325.dasm (0.77% of base)

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

Top method regressions (bytes):
           8 ( 0.77% of base) : 24325.dasm - Microsoft.CodeAnalysis.CSharp.OverloadResolution:NameUsedForPositional(Microsoft.CodeAnalysis.CSharp.AnalyzedArguments,ParameterMap):System.Nullable`1[Int32]

Top method regressions (percentages):
           8 ( 0.77% of base) : 24325.dasm - Microsoft.CodeAnalysis.CSharp.OverloadResolution:NameUsedForPositional(Microsoft.CodeAnalysis.CSharp.AnalyzedArguments,ParameterMap):System.Nullable`1[Int32]

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 141783
Total bytes of diff: 142157
Total bytes of delta: 374 (0.26% of base)
Total relative delta: 0.25
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
         129 : 244941.dasm (6.75% of base)
         129 : 240676.dasm (6.75% of base)
          51 : 190271.dasm (4.62% of base)
          51 : 190855.dasm (4.62% of base)
          34 : 190774.dasm (4.28% of base)
          34 : 190178.dasm (4.28% of base)
          26 : 190899.dasm (2.63% of base)
          21 : 190202.dasm (2.94% of base)
          21 : 190798.dasm (2.94% of base)
          21 : 190754.dasm (2.95% of base)
          13 : 190580.dasm (1.72% of base)
          10 : 190617.dasm (1.27% of base)
          10 : 189978.dasm (1.53% of base)
          10 : 190045.dasm (1.39% of base)
          10 : 190506.dasm (1.53% of base)
           6 : 19765.dasm (0.25% of base)
           6 : 19761.dasm (0.21% of base)
           5 : 214323.dasm (0.42% of base)
           5 : 74460.dasm (0.42% of base)
           5 : 74462.dasm (0.25% of base)

Top file improvements (bytes):
         -20 : 315756.dasm (-2.39% of base)
         -11 : 165175.dasm (-1.40% of base)
         -11 : 165144.dasm (-1.17% of base)
         -10 : 304532.dasm (-0.99% of base)
          -7 : 190505.dasm (-0.60% of base)
          -7 : 189977.dasm (-0.60% of base)
          -5 : 190008.dasm (-0.36% of base)
          -5 : 190604.dasm (-0.96% of base)
          -5 : 190612.dasm (-0.95% of base)
          -5 : 190586.dasm (-0.31% of base)
          -4 : 214538.dasm (-0.24% of base)
          -4 : 190219.dasm (-0.27% of base)
          -4 : 74659.dasm (-0.16% of base)
          -4 : 74677.dasm (-0.24% of base)
          -4 : 190277.dasm (-0.33% of base)
          -4 : 214520.dasm (-0.16% of base)
          -4 : 190861.dasm (-0.33% of base)
          -3 : 190214.dasm (-0.34% of base)
          -3 : 214622.dasm (-0.05% of base)
          -3 : 74703.dasm (-0.50% of base)

89 total files with Code Size differences (63 improved, 26 regressed), 4 unchanged.

Top method regressions (bytes):
         129 ( 6.75% of base) : 244941.dasm - System.Data.SqlClient.TdsParser:WriteSessionRecoveryFeatureRequest(System.Data.SqlClient.SessionData,bool):int:this
         129 ( 6.75% of base) : 240676.dasm - System.Data.SqlClient.TdsParser:WriteSessionRecoveryFeatureRequest(System.Data.SqlClient.SessionData,bool):int:this
          51 ( 4.62% of base) : 190271.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchIndexOfAny_TwoString()
          51 ( 4.62% of base) : 190855.dasm - System.SpanTests.SpanTests:TestMatchIndexOfAny_TwoString()
          34 ( 4.28% of base) : 190774.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_String_TwoByte()
          34 ( 4.28% of base) : 190178.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchLastIndexOfAny_String_TwoByte()
          26 ( 2.63% of base) : 190899.dasm - System.SpanTests.SpanTests:TestMatchIndexOfAny_TwoInteger()
          21 ( 2.94% of base) : 190202.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchLastIndexOfAny_Byte_TwoByte()
          21 ( 2.94% of base) : 190798.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_Byte_TwoByte()
          21 ( 2.95% of base) : 190754.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_TwoByte()
          13 ( 1.72% of base) : 190580.dasm - System.SpanTests.SpanTests:SequenceEqualNoMatch_Long()
          10 ( 1.27% of base) : 190617.dasm - System.SpanTests.SpanTests:MakeSureNoSequenceCompareToChecksGoOutOfRange()
          10 ( 1.53% of base) : 189978.dasm - System.SpanTests.ReadOnlySpanTests:MakeSureNoStartsWithChecksGoOutOfRange()
          10 ( 1.39% of base) : 190045.dasm - System.SpanTests.ReadOnlySpanTests:MakeSureNoSequenceCompareToChecksGoOutOfRange()
          10 ( 1.53% of base) : 190506.dasm - System.SpanTests.SpanTests:MakeSureNoStartsWithChecksGoOutOfRange()
           6 ( 0.25% of base) : 19765.dasm - System.Collections.Tests.LinkedList_Generic_Tests`1[Byte][System.Byte]:AddBefore_LLNode():this
           6 ( 0.21% of base) : 19761.dasm - System.Collections.Tests.LinkedList_Generic_Tests`1[Byte][System.Byte]:AddAfter_LLNode():this
           5 ( 0.42% of base) : 214323.dasm - System.Tests.StringTests:WhiteSpaceAtStartAndEndTrim()
           5 ( 0.42% of base) : 74460.dasm - System.Tests.StringTests:WhiteSpaceAtStartAndEndTrim()
           5 ( 0.25% of base) : 74462.dasm - System.Tests.StringTests:TrimWhiteSpaceMultipleTimes()

Top method improvements (bytes):
         -20 (-2.39% of base) : 315756.dasm - System.Net.Tests.WebHeaderCollectionTest:Getter_Success():this
         -11 (-1.40% of base) : 165175.dasm - System.Data.Tests.Common.DataTableMappingCollectionTest:CopyTo():this
         -11 (-1.17% of base) : 165144.dasm - System.Data.Tests.Common.DataColumnMappingCollectionTest:CopyTo():this
         -10 (-0.99% of base) : 304532.dasm - System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly:CreateMultipleConcurrentServers_ConnectMultipleClients(int)
          -7 (-0.60% of base) : 190505.dasm - System.SpanTests.SpanTests:StartsWithNoMatch()
          -7 (-0.60% of base) : 189977.dasm - System.SpanTests.ReadOnlySpanTests:StartsWithNoMatch()
          -5 (-0.36% of base) : 190008.dasm - System.SpanTests.ReadOnlySpanTests:SequenceEqualNoMatch(int)
          -5 (-0.96% of base) : 190604.dasm - System.SpanTests.SpanTests:SequenceCompareToWithSingleMismatch_Int()
          -5 (-0.95% of base) : 190612.dasm - System.SpanTests.SpanTests:SequenceCompareToWithSingleMismatch_Long()
          -5 (-0.31% of base) : 190586.dasm - System.SpanTests.SpanTests:SequenceEqualNoMatch(int)
          -4 (-0.24% of base) : 214538.dasm - System.Tests.StringTests:CompareToNoMatch_StringComparison()
          -4 (-0.27% of base) : 190219.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchIndexOfAny_ManyString()
          -4 (-0.16% of base) : 74659.dasm - System.Tests.StringTests:EndsWithNoMatch_StringComparison()
          -4 (-0.24% of base) : 74677.dasm - System.Tests.StringTests:CompareToNoMatch_StringComparison()
          -4 (-0.33% of base) : 190277.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchIndexOfAny_ThreeString()
          -4 (-0.16% of base) : 214520.dasm - System.Tests.StringTests:EndsWithNoMatch_StringComparison()
          -4 (-0.33% of base) : 190861.dasm - System.SpanTests.SpanTests:TestMatchIndexOfAny_ThreeString()
          -3 (-0.34% of base) : 190214.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchLastIndexOfAny_Byte_ManyByte()
          -3 (-0.05% of base) : 214622.dasm - System.Tests.StringTests:WhiteSpaceAtEndTrim_Memory()
          -3 (-0.50% of base) : 74703.dasm - System.Tests.StringTests:SequenceEqualNoMatch_Char()

Top method regressions (percentages):
         129 ( 6.75% of base) : 244941.dasm - System.Data.SqlClient.TdsParser:WriteSessionRecoveryFeatureRequest(System.Data.SqlClient.SessionData,bool):int:this
         129 ( 6.75% of base) : 240676.dasm - System.Data.SqlClient.TdsParser:WriteSessionRecoveryFeatureRequest(System.Data.SqlClient.SessionData,bool):int:this
          51 ( 4.62% of base) : 190271.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchIndexOfAny_TwoString()
          51 ( 4.62% of base) : 190855.dasm - System.SpanTests.SpanTests:TestMatchIndexOfAny_TwoString()
          34 ( 4.28% of base) : 190774.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_String_TwoByte()
          34 ( 4.28% of base) : 190178.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchLastIndexOfAny_String_TwoByte()
          21 ( 2.95% of base) : 190754.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_TwoByte()
          21 ( 2.94% of base) : 190202.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchLastIndexOfAny_Byte_TwoByte()
          21 ( 2.94% of base) : 190798.dasm - System.SpanTests.SpanTests:TestMatchLastIndexOfAny_Byte_TwoByte()
          26 ( 2.63% of base) : 190899.dasm - System.SpanTests.SpanTests:TestMatchIndexOfAny_TwoInteger()
          13 ( 1.72% of base) : 190580.dasm - System.SpanTests.SpanTests:SequenceEqualNoMatch_Long()
          10 ( 1.53% of base) : 189978.dasm - System.SpanTests.ReadOnlySpanTests:MakeSureNoStartsWithChecksGoOutOfRange()
          10 ( 1.53% of base) : 190506.dasm - System.SpanTests.SpanTests:MakeSureNoStartsWithChecksGoOutOfRange()
          10 ( 1.39% of base) : 190045.dasm - System.SpanTests.ReadOnlySpanTests:MakeSureNoSequenceCompareToChecksGoOutOfRange()
          10 ( 1.27% of base) : 190617.dasm - System.SpanTests.SpanTests:MakeSureNoSequenceCompareToChecksGoOutOfRange()
           4 ( 0.86% of base) : 214513.dasm - System.Tests.StringTests:EndsWithNoMatch_Char()
           4 ( 0.86% of base) : 74652.dasm - System.Tests.StringTests:EndsWithNoMatch_Char()
           5 ( 0.66% of base) : 322027.dasm - System.Net.Test.Uri.IriTest.IriEscapeUnescapeTest:EscapeUnescapeAllUriComponentsInDifferentCultures(System.String):this
           5 ( 0.42% of base) : 214323.dasm - System.Tests.StringTests:WhiteSpaceAtStartAndEndTrim()
           5 ( 0.42% of base) : 74460.dasm - System.Tests.StringTests:WhiteSpaceAtStartAndEndTrim()

Top method improvements (percentages):
         -20 (-2.39% of base) : 315756.dasm - System.Net.Tests.WebHeaderCollectionTest:Getter_Success():this
         -11 (-1.40% of base) : 165175.dasm - System.Data.Tests.Common.DataTableMappingCollectionTest:CopyTo():this
         -11 (-1.17% of base) : 165144.dasm - System.Data.Tests.Common.DataColumnMappingCollectionTest:CopyTo():this
         -10 (-0.99% of base) : 304532.dasm - System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly:CreateMultipleConcurrentServers_ConnectMultipleClients(int)
          -5 (-0.96% of base) : 190604.dasm - System.SpanTests.SpanTests:SequenceCompareToWithSingleMismatch_Int()
          -5 (-0.95% of base) : 190612.dasm - System.SpanTests.SpanTests:SequenceCompareToWithSingleMismatch_Long()
          -3 (-0.90% of base) : 190469.dasm - System.SpanTests.ReadOnlySpanTests:TestContains_Byte()
          -3 (-0.88% of base) : 191090.dasm - System.SpanTests.SpanTests:TestContains()
          -3 (-0.82% of base) : 191030.dasm - System.SpanTests.SpanTests:EndsWithNoMatch_Long()
          -3 (-0.82% of base) : 190396.dasm - System.SpanTests.ReadOnlySpanTests:EndsWithNoMatch_Long()
          -3 (-0.82% of base) : 189969.dasm - System.SpanTests.ReadOnlySpanTests:StartsWithNoMatch_Long()
          -3 (-0.82% of base) : 190555.dasm - System.SpanTests.SpanTests:StartsWithNoMatch_Long()
          -3 (-0.76% of base) : 191095.dasm - System.SpanTests.SpanTests:TestMatchContains_String()
          -3 (-0.76% of base) : 190481.dasm - System.SpanTests.ReadOnlySpanTests:TestMatchContains_String()
          -2 (-0.74% of base) : 190477.dasm - System.SpanTests.ReadOnlySpanTests:TestMultipleContains()
          -3 (-0.70% of base) : 190078.dasm - System.SpanTests.ReadOnlySpanTests:SequenceCompareToWithSingleMismatch_Bool()
          -3 (-0.69% of base) : 190031.dasm - System.SpanTests.ReadOnlySpanTests:SequenceCompareToWithSingleMismatch_Int()
          -3 (-0.68% of base) : 190039.dasm - System.SpanTests.ReadOnlySpanTests:SequenceCompareToWithSingleMismatch_Long()
          -3 (-0.60% of base) : 190641.dasm - System.SpanTests.SpanTests:SequenceCompareToWithSingleMismatch_Bool()
          -7 (-0.60% of base) : 190505.dasm - System.SpanTests.SpanTests:StartsWithNoMatch()

89 total methods with Code Size differences (63 improved, 26 regressed), 4 unchanged.


@BruceForstall
Copy link
Member 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.

// Insert condition 0 in 'h' and create other condition blocks and insert conditions in them.
// On entry, block 'h' is a conditional block, but its bbJumpDest hasn't yet been set.
// ...
// slowHead -?> e2 (slowHead) branch or fall-through to e2
Copy link
Member

Choose a reason for hiding this comment

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

e2 is the entry block of the slow loop, I take it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the "2" cases are the slow path blocks. I've tried to improve the comments over time, but I guess there is still room for improvement.

@BruceForstall BruceForstall merged commit 9d075ae into dotnet:main Sep 27, 2021
@BruceForstall BruceForstall deleted the ChangeCloningConditionsBlocks branch September 27, 2021 17:50
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 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.

2 participants