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

XARCH: Remove redudant tests for GT_LT/GT_GE relops. #61152

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

anthonycanino
Copy link
Contributor

This PR addresses #11414 but continues on with some of the work discussed in the Background section below.

Changes

We can now optimize cases such as (x + y < 0) or for (int x = v; x >= 0; x--)
using the flag tracking logic during the emit stage. Notably, cases that
would generate...

add     reg0, reg1
test    reg0, reg0
jge     LABEL

now transform to

add     reg0, reg1
jns     LABEL

This transform is valid for signed GE and signed LT only.

Background

It looks like dotnet/coreclr#14027 started some logic for reusing flags during the lowering stage, at which point some of the cases had to be restricted due to the OF #9059. There was some discussion about making this work for ADD/SUB + LT/GE but it looks like it was abandoned due to low optimization opportunity #6794 (comment).

More recently, a PR #38586 added flag tracking during the codegen/emit stage, and addressed some remaining optimization cases, e.g., (x ^ y) < 0.

I think with PR 38586, we can handle cases like if (x - y) < 0, or more importantly, for (int x = v; x >= 0; x -= 2) as we can now look at whether the previous instruction set the SF, and if we are in a GT_GE/GT_LT with a SLT,/SGE and instead emit a JS/JNS instead.

Results

The following is from an older run with superpmi (happy to grab an updated one if needed).

Overall, the change is an improvement. From inspecting some of the diffs, the absence of test instruction impacts some of the loop alignment. A lot of [align X bytes] were optimized out, but in some cases the change actually forced the insertion of alignment. Also, although this is an edge case, I noticed that with inlining there was a greater amount of (x - y) < 0 cases, as I saw a lot of Math.abs(x - y), which inlined to a case where we could remove a redundant check.


### aspnet.run.windows.x64.checked.mch:
Total bytes of base: 11830343 (overridden on cmd)
Total bytes of diff: 11829856 (overridden on cmd)
Total bytes of delta: -487 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
144 total files with Code Size differences (138 improved, 6 regressed), 7 unchanged.


### benchmarks.run.windows.x64.checked.mch:
Total bytes of base: 7188195 (overridden on cmd)
Total bytes of diff: 7187002 (overridden on cmd)
Total bytes of delta: -1193 (-0.02 % of base)
    diff is an improvement.
    relative diff is an improvement.
266 total files with Code Size differences (260 improved, 6 regressed), 9 unchanged.


### coreclr_tests.pmi.windows.x64.checked.mch:
Total bytes of base: 124413020 (overridden on cmd)
Total bytes of diff: 124411029 (overridden on cmd)
Total bytes of delta: -1991 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
378 total files with Code Size differences (376 improved, 2 regressed), 3 unchanged.


### libraries.crossgen2.windows.x64.checked.mch:
Total bytes of base: 34153782 (overridden on cmd)
Total bytes of diff: 34151790 (overridden on cmd)
Total bytes of delta: -1992 (-0.01 % of base)
    diff is an improvement.
    relative diff is an improvement.
590 total files with Code Size differences (590 improved, 0 regressed), 0 unchanged.


### libraries.pmi.windows.x64.checked.mch:
Total bytes of base: 45212184 (overridden on cmd)
Total bytes of diff: 45209998 (overridden on cmd)
Total bytes of delta: -2186 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
688 total files with Code Size differences (681 improved, 7 regressed), 5 unchanged.


### libraries_tests.pmi.windows.x64.checked.mch:
Total bytes of base: 112874921 (overridden on cmd)
Total bytes of diff: 112872212 (overridden on cmd)
Total bytes of delta: -2709 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
670 total methods with Code Size differences (669 improved, 1 regressed), 7 unchanged.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Nov 3, 2021
@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 Nov 3, 2021
@ghost
Copy link

ghost commented Nov 3, 2021

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

Issue Details

This PR addresses #11414 but continues on with some of the work discussed in the Background section below.

Changes

We can now optimize cases such as (x + y < 0) or for (int x = v; x >= 0; x--)
using the flag tracking logic during the emit stage. Notably, cases that
would generate...

add     reg0, reg1
test    reg0, reg0
jge     LABEL

now transform to

add     reg0, reg1
jns     LABEL

This transform is valid for signed GE and signed LT only.

Background

It looks like dotnet/coreclr#14027 started some logic for reusing flags during the lowering stage, at which point some of the cases had to be restricted due to the OF #9059. There was some discussion about making this work for ADD/SUB + LT/GE but it looks like it was abandoned due to low optimization opportunity #6794 (comment).

More recently, a PR #38586 added flag tracking during the codegen/emit stage, and addressed some remaining optimization cases, e.g., (x ^ y) < 0.

I think with PR 38586, we can handle cases like if (x - y) < 0, or more importantly, for (int x = v; x >= 0; x -= 2) as we can now look at whether the previous instruction set the SF, and if we are in a GT_GE/GT_LT with a SLT,/SGE and instead emit a JS/JNS instead.

Results

The following is from an older run with superpmi (happy to grab an updated one if needed).

Overall, the change is an improvement. From inspecting some of the diffs, the absence of test instruction impacts some of the loop alignment. A lot of [align X bytes] were optimized out, but in some cases the change actually forced the insertion of alignment. Also, although this is an edge case, I noticed that with inlining there was a greater amount of (x - y) < 0 cases, as I saw a lot of Math.abs(x - y), which inlined to a case where we could remove a redundant check.


### aspnet.run.windows.x64.checked.mch:
Total bytes of base: 11830343 (overridden on cmd)
Total bytes of diff: 11829856 (overridden on cmd)
Total bytes of delta: -487 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
144 total files with Code Size differences (138 improved, 6 regressed), 7 unchanged.


### benchmarks.run.windows.x64.checked.mch:
Total bytes of base: 7188195 (overridden on cmd)
Total bytes of diff: 7187002 (overridden on cmd)
Total bytes of delta: -1193 (-0.02 % of base)
    diff is an improvement.
    relative diff is an improvement.
266 total files with Code Size differences (260 improved, 6 regressed), 9 unchanged.


### coreclr_tests.pmi.windows.x64.checked.mch:
Total bytes of base: 124413020 (overridden on cmd)
Total bytes of diff: 124411029 (overridden on cmd)
Total bytes of delta: -1991 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
378 total files with Code Size differences (376 improved, 2 regressed), 3 unchanged.


### libraries.crossgen2.windows.x64.checked.mch:
Total bytes of base: 34153782 (overridden on cmd)
Total bytes of diff: 34151790 (overridden on cmd)
Total bytes of delta: -1992 (-0.01 % of base)
    diff is an improvement.
    relative diff is an improvement.
590 total files with Code Size differences (590 improved, 0 regressed), 0 unchanged.


### libraries.pmi.windows.x64.checked.mch:
Total bytes of base: 45212184 (overridden on cmd)
Total bytes of diff: 45209998 (overridden on cmd)
Total bytes of delta: -2186 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
688 total files with Code Size differences (681 improved, 7 regressed), 5 unchanged.


### libraries_tests.pmi.windows.x64.checked.mch:
Total bytes of base: 112874921 (overridden on cmd)
Total bytes of diff: 112872212 (overridden on cmd)
Total bytes of delta: -2709 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
670 total methods with Code Size differences (669 improved, 1 regressed), 7 unchanged.
Author: anthonycanino
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

We can now optimize cases such as `(x + y < 0)` or `for (int x = v; x >= 0; x--)`
using the flag tracking logic during the emit stage. Notably, cases that
would generate...

```
add     reg0, reg1
test    reg0, reg0
jge     LABEL
```

now transform to

```
add     reg0, reg1
jns     LABEL
```

This transform is valid for signed GE and signed LT only.
@anthonycanino
Copy link
Contributor Author

anthonycanino commented Nov 4, 2021

I believe the Linux x64 test Interop/PInvoke/Generics/GenericsTest/GenericsTest.sh currently failing on main (#61300)

@anthonycanino
Copy link
Contributor Author

Hi @JulieLeeMSFT , can you please assign this to someone who can review the PR?

@AndyAyersMS
Copy link
Member

Hi @anthonycanino, I'll take a look.

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.

cc @dotnet/jit-contrib

Overall this looks good to me. I'll run some extra CI legs here for you just in case.

Can you add the diff summary report (artifacts\spmi\diff_summary.md)?

{
assert(reg != REG_NA);

// Don't look back across IG boundaries (possible control flow)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a check like

   if (!emitComp->opts.OptimizationEnabled()) 
   {
      return false;
   }

(or else assert we're optimizing)

I realize this is also guaranteed by the way the current caller sets canReuseFlags but would prefer we check these things closer to where we actually do the transformation.

(and add similar to AreFlagsSetToZeroCmp if you don't mind)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in both spots. Thanks!

else if (canReuseFlags && emit->AreFlagsSetForSignJumpOpt(op1->GetRegNum(), emitTypeSize(type), tree))
{
JITDUMP("Not emitting compare due to sign being already set, follow up instr will transform jump\n");
tree->gtFlags |= GTF_RELOP_SJUMP_OPT;
Copy link
Member

Choose a reason for hiding this comment

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

Can you either always clear this new flag up above before the if on line 6231, or assert there that it's not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the assertion next to the other ones. Please let me know if the comment needs to change or if its good enough.

Comment on lines +438 to +464
insFormat fmt = id->idInsFmt();

// make sure op1 is a reg
switch (fmt)
{
case IF_RWR_CNS:
case IF_RRW_CNS:
case IF_RRW_SHF:
case IF_RWR_RRD:
case IF_RRW_RRD:
case IF_RWR_MRD:
case IF_RWR_SRD:
case IF_RRW_SRD:
case IF_RWR_ARD:
case IF_RRW_ARD:
case IF_RWR:
case IF_RRD:
case IF_RRW:
break;
default:
return false;
}

if (id->idReg1() != reg)
{
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

We should think about extracting things that are common as helper methods. But maybe do this as a zero-diff follow up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, happy to do a follow up refactor.

@AndyAyersMS
Copy link
Member

/azp run Fuzzlyn

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS AndyAyersMS self-assigned this Nov 9, 2021
@AndyAyersMS
Copy link
Member

x86 Fuzzlyn failures seem unrelated, arm failures certainly are.

Linux x64 failures are instances of #61237 which is unrelated and has been fixed.

So things look good on the testing front.

@anthonycanino
Copy link
Contributor Author

Thanks @AndyAyersMS . Here is the diff_summary.md report. I will respond to your comments inline.

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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 13673308 (overridden on cmd)
Total bytes of diff: 13672901 (overridden on cmd)
Total bytes of delta: -407 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          25 : 43162.dasm (0.63% of base)
           9 : 28756.dasm (1.31% of base)
           9 : 39484.dasm (1.31% of base)
           9 : 6896.dasm (1.08% of base)
           9 : 14559.dasm (1.31% of base)
           9 : 41738.dasm (1.31% of base)
           9 : 5032.dasm (1.31% of base)
           9 : 4326.dasm (1.08% of base)
           9 : 42767.dasm (1.31% of base)

Top file improvements (bytes):
         -29 : 41838.dasm (-1.10% of base)
         -19 : 38845.dasm (-2.81% of base)
         -16 : 6787.dasm (-3.59% of base)
         -16 : 992.dasm (-3.59% of base)
         -11 : 21152.dasm (-2.15% of base)
          -9 : 18104.dasm (-0.45% of base)
          -9 : 29243.dasm (-0.85% of base)
          -9 : 24227.dasm (-0.44% of base)
          -8 : 19750.dasm (-1.23% of base)
          -6 : 8593.dasm (-0.83% of base)
          -6 : 21201.dasm (-0.42% of base)
          -6 : 20282.dasm (-0.50% of base)
          -6 : 29248.dasm (-10.34% of base)
          -6 : 40830.dasm (-2.78% of base)
          -6 : 9541.dasm (-1.10% of base)
          -6 : 40216.dasm (-10.34% of base)
          -6 : 13999.dasm (-0.89% of base)
          -6 : 22316.dasm (-10.34% of base)
          -6 : 38452.dasm (-0.91% of base)
          -6 : 10954.dasm (-1.10% of base)

143 total files with Code Size differences (134 improved, 9 regressed), 6 unchanged.

Top method regressions (bytes):
          25 ( 0.63% of base) : 43162.dasm - HttpParser`1:ParseMultiSpanHeader(Http1ParsingHandler,byref):int:this
           9 ( 1.31% of base) : 28756.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 39484.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 14559.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 41738.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 5032.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 42767.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.08% of base) : 6896.dasm - SpanHelpers:IndexOfAny(byref,ubyte,ubyte,ubyte,int):int
           9 ( 1.08% of base) : 4326.dasm - SpanHelpers:IndexOfAny(byref,ubyte,ubyte,ubyte,int):int

Top method improvements (bytes):
         -29 (-1.10% of base) : 41838.dasm - HttpParser`1:ParseHeaders(Http1ParsingHandler,byref):bool:this
         -19 (-2.81% of base) : 38845.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ReadOnlySpan`1):int
         -16 (-3.59% of base) : 6787.dasm - SpanHelpers:IndexOfAny(byref,ushort,ushort,int):int
         -16 (-3.59% of base) : 992.dasm - SpanHelpers:IndexOfAny(byref,ushort,ushort,int):int
         -11 (-2.15% of base) : 21152.dasm - StringBuilder:CopyTo(int,Span`1,int):this
          -9 (-0.45% of base) : 18104.dasm - KeyDiscoveryConvention:TryConfigurePrimaryKey(IConventionEntityTypeBuilder):this
          -9 (-0.44% of base) : 24227.dasm - KeyDiscoveryConvention:TryConfigurePrimaryKey(IConventionEntityTypeBuilder):this
          -9 (-0.85% of base) : 29243.dasm - Number:<FormatUInt32>g__FormatUInt32Slow|42_0(int,String,IFormatProvider):String
          -8 (-1.23% of base) : 19750.dasm - SelectExpression:Prune(IReadOnlyCollection`1):SelectExpression:this
          -6 (-0.42% of base) : 21201.dasm - CallSiteFactory:TryCreateEnumerable(Type,CallSiteChain):ServiceCallSite:this
          -6 (-2.78% of base) : 40830.dasm - ChunkWriter:BeginChunkBytes(int,Span`1):int
          -6 (-0.83% of base) : 8593.dasm - DateTimeOffset:ToLocalTime(DateTime,bool):DateTimeOffset
          -6 (-1.10% of base) : 9541.dasm - HashSet`1:FindItemIndex(__Canon):int:this
          -6 (-0.89% of base) : 13999.dasm - HashSet`1:FindItemIndex(__Canon):int:this
          -6 (-0.91% of base) : 38452.dasm - HashSet`1:FindItemIndex(__Canon):int:this
          -6 (-1.10% of base) : 10954.dasm - HashSet`1:FindItemIndex(__Canon):int:this
          -6 (-1.10% of base) : 20893.dasm - HashSet`1:FindItemIndex(__Canon):int:this
          -6 (-0.50% of base) : 20282.dasm - NpgsqlConnector:WriteStartup(Dictionary`2):this
          -6 (-10.34% of base) : 29248.dasm - Number:Int32ToHexChars(long,int,int,int):long
          -6 (-10.34% of base) : 40216.dasm - Number:Int32ToHexChars(long,int,int,int):long

Top method regressions (percentages):
           9 ( 1.31% of base) : 28756.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 39484.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 14559.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 41738.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 5032.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.31% of base) : 42767.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ubyte,ubyte):int
           9 ( 1.08% of base) : 6896.dasm - SpanHelpers:IndexOfAny(byref,ubyte,ubyte,ubyte,int):int
           9 ( 1.08% of base) : 4326.dasm - SpanHelpers:IndexOfAny(byref,ubyte,ubyte,ubyte,int):int
          25 ( 0.63% of base) : 43162.dasm - HttpParser`1:ParseMultiSpanHeader(Http1ParsingHandler,byref):int:this

Top method improvements (percentages):
          -6 (-10.34% of base) : 29248.dasm - Number:Int32ToHexChars(long,int,int,int):long
          -6 (-10.34% of base) : 40216.dasm - Number:Int32ToHexChars(long,int,int,int):long
          -6 (-10.34% of base) : 22316.dasm - Number:Int32ToHexChars(long,int,int,int):long
         -16 (-3.59% of base) : 6787.dasm - SpanHelpers:IndexOfAny(byref,ushort,ushort,int):int
         -16 (-3.59% of base) : 992.dasm - SpanHelpers:IndexOfAny(byref,ushort,ushort,int):int
         -19 (-2.81% of base) : 38845.dasm - MemoryExtensions:IndexOfAny(ReadOnlySpan`1,ReadOnlySpan`1):int
          -6 (-2.78% of base) : 40830.dasm - ChunkWriter:BeginChunkBytes(int,Span`1):int
          -3 (-2.44% of base) : 38519.dasm - Enum:FindDefinedIndex(ref,long):int
          -4 (-2.30% of base) : 29246.dasm - Number:Int32ToHexStr(int,ushort,int):String
         -11 (-2.15% of base) : 21152.dasm - StringBuilder:CopyTo(int,Span`1,int):this
          -2 (-2.13% of base) : 38803.dasm - UTF8Encoding:GetCharCountCommon(long,int):int:this
          -2 (-2.13% of base) : 28601.dasm - UTF8Encoding:GetCharCountCommon(long,int):int:this
          -3 (-1.94% of base) : 8621.dasm - DateTime:ToFileTimeUtc():long:this
          -3 (-1.87% of base) : 20927.dasm - Enum:GetEnumName(EnumInfo,long):String
          -3 (-1.86% of base) : 8441.dasm - DateTimeOffset:ValidateDate(DateTime,TimeSpan):DateTime
          -3 (-1.86% of base) : 14239.dasm - DateTimeOffset:ValidateDate(DateTime,TimeSpan):DateTime
          -3 (-1.86% of base) : 39743.dasm - DateTimeOffset:ValidateDate(DateTime,TimeSpan):DateTime
          -3 (-1.85% of base) : 38518.dasm - Enum:GetEnumName(EnumInfo,long):String
          -2 (-1.71% of base) : 28572.dasm - UTF8Encoding:GetByteCountCommon(long,int):int:this
          -2 (-1.71% of base) : 38612.dasm - UTF8Encoding:GetByteCountCommon(long,int):int:this

143 total methods with Code Size differences (134 improved, 9 regressed), 6 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 7177715 (overridden on cmd)
Total bytes of diff: 7176533 (overridden on cmd)
Total bytes of delta: -1182 (-0.02 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          22 : 16443.dasm (2.51% of base)
          11 : 13052.dasm (15.71% of base)
           7 : 437.dasm (0.97% of base)
           5 : 5389.dasm (1.05% of base)
           1 : 11705.dasm (0.56% of base)

Top file improvements (bytes):
         -41 : 10749.dasm (-0.40% of base)
         -38 : 10750.dasm (-0.36% of base)
         -30 : 6455.dasm (-0.42% of base)
         -29 : 16057.dasm (-2.77% of base)
         -26 : 12916.dasm (-0.21% of base)
         -26 : 10746.dasm (-0.21% of base)
         -24 : 16075.dasm (-0.50% of base)
         -23 : 12919.dasm (-0.41% of base)
         -21 : 16071.dasm (-0.38% of base)
         -20 : 12388.dasm (-1.78% of base)
         -20 : 6699.dasm (-1.23% of base)
         -18 : 2506.dasm (-0.35% of base)
         -16 : 8952.dasm (-1.69% of base)
         -13 : 9978.dasm (-1.22% of base)
         -12 : 16076.dasm (-0.45% of base)
         -12 : 16070.dasm (-0.46% of base)
         -12 : 16073.dasm (-0.38% of base)
         -12 : 6441.dasm (-0.41% of base)
         -11 : 18725.dasm (-0.58% of base)
         -11 : 10736.dasm (-0.43% of base)

266 total files with Code Size differences (261 improved, 5 regressed), 11 unchanged.

Top method regressions (bytes):
          22 ( 2.51% of base) : 16443.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,ushort,int):int
          11 (15.71% of base) : 13052.dasm - System.Collections.IndexerSetReverse`1[Int32][System.Int32]:List():System.Collections.Generic.List`1[Int32]:this
           7 ( 0.97% of base) : 437.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,int):int
           5 ( 1.05% of base) : 5389.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
           1 ( 0.56% of base) : 11705.dasm - System.Number:TryNumberToInt32(byref,byref):bool

Top method improvements (bytes):
         -41 (-0.40% of base) : 10749.dasm - Utf8Json.Internal.NumberConverter:WriteInt64(byref,int,long):int
         -38 (-0.36% of base) : 10750.dasm - Utf8Json.JsonWriter:WriteInt64(long):this
         -30 (-0.42% of base) : 6455.dasm - MessagePack.Formatters.DateTimeOffsetFormatter:Serialize(byref,int,System.DateTimeOffset,MessagePack.IFormatterResolver):int:this
         -29 (-2.77% of base) : 16057.dasm - LUDecomp:build_problem(System.Double[][],int,System.Double[])
         -26 (-0.21% of base) : 12916.dasm - Utf8Json.Formatters.ISO8601DateTimeFormatter:Serialize(byref,System.DateTime,Utf8Json.IJsonFormatterResolver):this
         -26 (-0.21% of base) : 10746.dasm - Utf8Json.Formatters.ISO8601DateTimeOffsetFormatter:Serialize(byref,System.DateTimeOffset,Utf8Json.IJsonFormatterResolver):this
         -24 (-0.50% of base) : 16075.dasm - MessagePack.Formatters.Int32Formatter:Serialize(byref,int,int,MessagePack.IFormatterResolver):int:this
         -23 (-0.41% of base) : 12919.dasm - Utf8Json.Formatters.DictionaryFormatterBase`5[Int32,__Canon,__Canon,Enumerator,__Canon][System.Int32,System.__Canon,System.__Canon,System.Collections.Generic.Dictionary`2+Enumerator[System.Int32,System.__Canon],System.__Canon]:Serialize(byref,System.__Canon,Utf8Json.IJsonFormatterResolver):this
         -21 (-0.38% of base) : 16071.dasm - MessagePack.Formatters.DateTimeArrayFormatter:Serialize(byref,int,System.DateTime[],MessagePack.IFormatterResolver):int:this
         -20 (-1.78% of base) : 12388.dasm - Jil.Deserialize.Methods:_ReadInt32(System.IO.TextReader):int
         -20 (-1.23% of base) : 6699.dasm - Jil.Deserialize.Methods:_ReadInt32ThunkReader(byref):int
         -18 (-0.35% of base) : 2506.dasm - Utf8Json.JsonReader:ReadStringSegmentCore(byref,byref,byref):this
         -16 (-1.69% of base) : 8952.dasm - System.Number:TryNumberToDecimal(byref,byref):bool
         -13 (-1.22% of base) : 9978.dasm - Enumerator:MoveNext():bool:this
         -12 (-0.46% of base) : 16070.dasm - MessagePack.Formatters.ByteArrayFormatter:Serialize(byref,int,System.Byte[],MessagePack.IFormatterResolver):int:this
         -12 (-0.38% of base) : 16073.dasm - MessagePack.Formatters.DictionaryFormatterBase`5[Int32,__Canon,__Canon,Enumerator,__Canon][System.Int32,System.__Canon,System.__Canon,System.Collections.Generic.Dictionary`2+Enumerator[System.Int32,System.__Canon],System.__Canon]:Serialize(byref,int,System.__Canon,MessagePack.IFormatterResolver):int:this
         -12 (-0.41% of base) : 6441.dasm - MessagePack.Formatters.ListFormatter`1[__Canon][System.__Canon]:Serialize(byref,int,System.Collections.Generic.List`1[__Canon],MessagePack.IFormatterResolver):int:this
         -12 (-0.45% of base) : 16076.dasm - MessagePack.Formatters.ListFormatter`1[Int32][System.Int32]:Serialize(byref,int,System.Collections.Generic.List`1[Int32],MessagePack.IFormatterResolver):int:this
         -11 (-0.58% of base) : 18725.dasm - Microsoft.CodeAnalysis.CSharp.DataFlowPass:Scan(byref):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.PreciseAbstractFlowPass`1+PendingBranch[[Microsoft.CodeAnalysis.CSharp.DataFlowPass+LocalState, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
         -11 (-0.43% of base) : 10736.dasm - Utf8Json.Formatters.ListFormatter`1[__Canon][System.__Canon]:Serialize(byref,System.Collections.Generic.List`1[__Canon],Utf8Json.IJsonFormatterResolver):this

Top method regressions (percentages):
          11 (15.71% of base) : 13052.dasm - System.Collections.IndexerSetReverse`1[Int32][System.Int32]:List():System.Collections.Generic.List`1[Int32]:this
          22 ( 2.51% of base) : 16443.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,ushort,int):int
           5 ( 1.05% of base) : 5389.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
           7 ( 0.97% of base) : 437.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,int):int
           1 ( 0.56% of base) : 11705.dasm - System.Number:TryNumberToInt32(byref,byref):bool

Top method improvements (percentages):
          -6 (-10.34% of base) : 473.dasm - System.Number:Int32ToHexChars(long,int,int,int):long
          -6 (-8.82% of base) : 8945.dasm - System.Number:UInt32ToDecChars(long,int,int):long
          -6 (-8.57% of base) : 925.dasm - System.Number:UInt32ToDecChars(long,int,int):long
          -4 (-5.97% of base) : 12562.dasm - System.Collections.IndexerSetReverse`1[Int32][System.Int32]:Span():int:this
          -4 (-5.88% of base) : 15731.dasm - System.Collections.IndexerSetReverse`1[__Canon][System.__Canon]:List():System.Collections.Generic.List`1[__Canon]:this
          -4 (-5.71% of base) : 14026.dasm - System.Collections.IndexerSetReverse`1[Int32][System.Int32]:Set(System.Collections.Generic.IList`1[Int32]):System.Collections.Generic.IList`1[Int32]:this
          -4 (-5.63% of base) : 16289.dasm - System.Collections.IndexerSetReverse`1[__Canon][System.__Canon]:Set(System.Collections.Generic.IList`1[__Canon]):System.Collections.Generic.IList`1[__Canon]:this
          -6 (-5.17% of base) : 23377.dasm - V8.Crypto.BigInteger:copyTo(V8.Crypto.BigInteger):this
          -4 (-4.44% of base) : 17800.dasm - Roslyn.Utilities.FileNameUtilities:IndexOfFileName(System.String):int
          -4 (-4.44% of base) : 9900.dasm - System.Reflection.Metadata.PathUtilities:IndexOfFileName(System.String):int
          -2 (-3.12% of base) : 14566.dasm - System.Collections.IndexerSetReverse`1[__Canon][System.__Canon]:Array():System.__Canon[]:this
          -2 (-3.12% of base) : 11863.dasm - System.Collections.IndexerSetReverse`1[Int32][System.Int32]:Array():System.Int32[]:this
          -3 (-3.06% of base) : 26284.dasm - System.IO.Path:HasExtension(System.ReadOnlySpan`1[Char]):bool
          -4 (-3.03% of base) : 17148.dasm - Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.SlidingTextWindow:Reset(int):this
          -2 (-3.03% of base) : 25888.dasm - System.SpanHelpers:BinarySearch(byref,int,ubyte):int
          -2 (-3.03% of base) : 21362.dasm - System.SpanHelpers:BinarySearch(byref,int,ushort):int
          -3 (-2.94% of base) : 21071.dasm - System.Numerics.BigIntegerCalculator:Divide(System.ReadOnlySpan`1[UInt32],int,System.Span`1[UInt32])
          -3 (-2.86% of base) : 15290.dasm - System.Numerics.BigIntegerCalculator:Compare(System.ReadOnlySpan`1[UInt32],System.ReadOnlySpan`1[UInt32]):int
          -6 (-2.79% of base) : 726.dasm - BigInteger:Compare(byref,byref):int
         -29 (-2.77% of base) : 16057.dasm - LUDecomp:build_problem(System.Double[][],int,System.Double[])

266 total methods with Code Size differences (261 improved, 5 regressed), 11 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 124728103 (overridden on cmd)
Total bytes of diff: 124726076 (overridden on cmd)
Total bytes of delta: -2027 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          55 : 239450.dasm (0.51% of base)

Top file improvements (bytes):
        -184 : 216193.dasm (-5.05% of base)
         -29 : 191775.dasm (-2.77% of base)
         -24 : 154940.dasm (-0.90% of base)
         -24 : 171473.dasm (-10.21% of base)
         -24 : 151757.dasm (-8.05% of base)
         -24 : 152464.dasm (-0.90% of base)
         -24 : 154427.dasm (-7.89% of base)
         -22 : 154457.dasm (-7.01% of base)
         -22 : 151791.dasm (-7.01% of base)
         -21 : 152406.dasm (-4.99% of base)
         -18 : 209258.dasm (-0.34% of base)
         -17 : 218893.dasm (-28.33% of base)
         -15 : 151886.dasm (-0.51% of base)
         -15 : 155149.dasm (-0.88% of base)
         -15 : 152774.dasm (-0.87% of base)
         -15 : 152549.dasm (-0.49% of base)
         -15 : 154900.dasm (-5.24% of base)
         -13 : 238108.dasm (-0.22% of base)
         -13 : 238113.dasm (-0.22% of base)
         -13 : 239359.dasm (-4.87% of base)

380 total files with Code Size differences (379 improved, 1 regressed), 4 unchanged.

Top method regressions (bytes):
          55 ( 0.51% of base) : 239450.dasm - Benchstone.MDBenchF.MDLLoops:Main1(int):this

Top method improvements (bytes):
        -184 (-5.05% of base) : 216193.dasm - JIT.HardwareIntrinsics.X86.SimpleBinaryOpTest__MultipleSumAbsoluteDifferences:ValidateResult(System.Byte[],System.Byte[],ubyte,System.UInt16[],System.String):this
         -29 (-2.77% of base) : 191775.dasm - LUDecomp:build_problem(System.Double[][],int,System.Double[])
         -24 (-10.21% of base) : 171473.dasm - Chaos.A0:RecurseA0(int):this
         -24 (-0.90% of base) : 154940.dasm - testout1:Func_0_4_5_1_4():System.Decimal
         -24 (-0.90% of base) : 152464.dasm - testout1:Func_0_4_5_1_4():System.Decimal
         -24 (-8.05% of base) : 151757.dasm - testout1:Func_0_4_6_6():long
         -24 (-7.89% of base) : 154427.dasm - testout1:Func_0_4_6_6():long
         -22 (-7.01% of base) : 154457.dasm - testout1:Func_0_5_5_6():long
         -22 (-7.01% of base) : 151791.dasm - testout1:Func_0_5_5_6():long
         -21 (-4.99% of base) : 152406.dasm - testout1:Func_0_4_3_1_6():long
         -18 (-0.34% of base) : 209258.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeAutoFieldLayout(Internal.TypeSystem.MetadataType,int):Internal.TypeSystem.ComputedInstanceFieldLayout:this
         -17 (-28.33% of base) : 218893.dasm - Span.SpanBench:TestFillAllReverseSpan(System.Span`1[Byte])
         -15 (-0.51% of base) : 151886.dasm - testout1:Func_0_1_3_6_1():float
         -15 (-5.24% of base) : 154900.dasm - testout1:Func_0_4_3_1_6():long
         -15 (-0.49% of base) : 152549.dasm - testout1:Func_0_5_2_2_3():long
         -15 (-0.88% of base) : 155149.dasm - testout1:Func_0_6_3_1_6():int
         -15 (-0.87% of base) : 152774.dasm - testout1:Func_0_6_3_1_6():int
         -13 (-4.87% of base) : 239359.dasm - BenchmarksGame.FannkuchRedux_9:FirstPermutation(long,long,long,int,int)
         -13 (-0.22% of base) : 238108.dasm - testout1:Func_0():int
         -13 (-0.22% of base) : 238113.dasm - testout1:Func_0():int

Top method regressions (percentages):
          55 ( 0.51% of base) : 239450.dasm - Benchstone.MDBenchF.MDLLoops:Main1(int):this

Top method improvements (percentages):
         -17 (-28.33% of base) : 218893.dasm - Span.SpanBench:TestFillAllReverseSpan(System.Span`1[Byte])
          -5 (-11.11% of base) : 218895.dasm - Span.SpanBench:TestFillAllReverseArray(System.Byte[])
          -3 (-10.34% of base) : 242787.dasm - test:test_111():long
         -24 (-10.21% of base) : 171473.dasm - Chaos.A0:RecurseA0(int):this
         -24 (-8.05% of base) : 151757.dasm - testout1:Func_0_4_6_6():long
         -24 (-7.89% of base) : 154427.dasm - testout1:Func_0_4_6_6():long
          -2 (-7.69% of base) : 1405.dasm - JIT.HardwareIntrinsics.Arm.Helpers:HighestSetBit(int):int
          -2 (-7.41% of base) : 1403.dasm - JIT.HardwareIntrinsics.Arm.Helpers:HighestSetBit(int):int
          -2 (-7.41% of base) : 1397.dasm - JIT.HardwareIntrinsics.Arm.Helpers:HighestSetBit(ubyte):int
          -2 (-7.41% of base) : 1401.dasm - JIT.HardwareIntrinsics.Arm.Helpers:HighestSetBit(ushort):int
         -12 (-7.36% of base) : 171411.dasm - Chaos.A0:RecurseA0(int):this
         -22 (-7.01% of base) : 154457.dasm - testout1:Func_0_5_5_6():long
         -22 (-7.01% of base) : 151791.dasm - testout1:Func_0_5_5_6():long
          -2 (-6.45% of base) : 1395.dasm - JIT.HardwareIntrinsics.Arm.Helpers:HighestSetBit(byte):int
          -2 (-6.45% of base) : 1399.dasm - JIT.HardwareIntrinsics.Arm.Helpers:HighestSetBit(short):int
          -9 (-6.34% of base) : 151754.dasm - testout1:Func_0_5_1_3():double
          -4 (-5.97% of base) : 223076.dasm - Tracing.Tests.Common.ExpectedEventCount:CheckErrorBounds(int):bool:this
         -15 (-5.24% of base) : 154900.dasm - testout1:Func_0_4_3_1_6():long
          -6 (-5.17% of base) : 219045.dasm - V8.Crypto.BigInteger:copyTo(V8.Crypto.BigInteger):this
        -184 (-5.05% of base) : 216193.dasm - JIT.HardwareIntrinsics.X86.SimpleBinaryOpTest__MultipleSumAbsoluteDifferences:ValidateResult(System.Byte[],System.Byte[],ubyte,System.UInt16[],System.String):this

380 total methods with Code Size differences (379 improved, 1 regressed), 4 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 34375803 (overridden on cmd)
Total bytes of diff: 34373774 (overridden on cmd)
Total bytes of delta: -2029 (-0.01 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -18 : 164733.dasm (-0.81% of base)
         -18 : 82837.dasm (-1.34% of base)
         -15 : 2634.dasm (-3.24% of base)
         -15 : 2635.dasm (-3.11% of base)
         -14 : 38246.dasm (-3.25% of base)
         -12 : 165525.dasm (-0.54% of base)
         -12 : 122356.dasm (-2.54% of base)
         -12 : 63997.dasm (-6.09% of base)
         -12 : 125955.dasm (-0.59% of base)
         -12 : 41818.dasm (-0.35% of base)
         -10 : 120909.dasm (-4.88% of base)
         -10 : 107620.dasm (-0.51% of base)
         -10 : 38453.dasm (-2.15% of base)
         -10 : 63995.dasm (-3.26% of base)
         -10 : 9348.dasm (-1.76% of base)
          -9 : 119687.dasm (-0.64% of base)
          -9 : 79109.dasm (-0.65% of base)
          -9 : 119570.dasm (-2.76% of base)
          -9 : 200623.dasm (-0.80% of base)
          -9 : 79027.dasm (-0.79% of base)

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

Top method improvements (bytes):
         -18 (-0.81% of base) : 164733.dasm - <SendBlobAsync>d__122`1:MoveNext():this
         -18 (-1.34% of base) : 82837.dasm - DecCalc:ScaleResult(long,int,int):int
         -15 (-3.11% of base) : 2635.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int32TryParse(System.Char[],int,int,byref):int
         -15 (-3.24% of base) : 2634.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
         -14 (-3.25% of base) : 38246.dasm - System.Data.SqlTypes.StreamOnSqlBytes:Seek(long,int):long:this
         -12 (-0.54% of base) : 165525.dasm - <SendBlobAsync>d__122`1:MoveNext():this
         -12 (-2.54% of base) : 122356.dasm - Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter:build@610-1(System.Type,System.Linq.Expressions.Expression[]):System.Linq.Expressions.Expression
         -12 (-6.09% of base) : 63997.dasm - System.Collections.Hashtable:ContainsValue(System.Object):bool:this
         -12 (-0.35% of base) : 41818.dasm - System.Data.XmlDataLoader:LoadTable(System.Data.DataTable,bool):this
         -12 (-0.59% of base) : 125955.dasm - System.Text.RegularExpressions.RegexInterpreter:FindFirstChar():bool:this
         -10 (-4.88% of base) : 120909.dasm - ByteStream:ReadBytes(int):System.Byte[]:this
         -10 (-1.76% of base) : 9348.dasm - Enumerator:MoveNext():bool:this
         -10 (-0.51% of base) : 107620.dasm - Microsoft.CodeAnalysis.VisualBasic.LocalRewriter:VisitUsingStatement(Microsoft.CodeAnalysis.VisualBasic.BoundUsingStatement):Microsoft.CodeAnalysis.VisualBasic.BoundNode:this
         -10 (-3.26% of base) : 63995.dasm - System.Collections.Hashtable:CopyEntries(System.Array,int):this
         -10 (-2.15% of base) : 38453.dasm - System.Data.SqlTypes.SqlXmlStreamWrapper:Seek(long,int):long:this
          -9 (-0.79% of base) : 79027.dasm - BigInteger:DivRem(byref,byref,byref,byref)
          -9 (-2.76% of base) : 119570.dasm - getTupleConstructor@720:Invoke(System.Object[]):System.Object:this
          -9 (-0.64% of base) : 119687.dasm - Microsoft.FSharp.Reflection.Impl:mkTupleType(bool,System.Reflection.Assembly,System.Type[]):System.Type
          -9 (-0.80% of base) : 200623.dasm - Number:FormatFixed(byref,byref,int,int,System.Globalization.NumberFormatInfo,System.Int32[],System.String,System.String)
          -9 (-0.65% of base) : 79109.dasm - System.Number:FormatFixed(byref,byref,int,System.Int32[],System.String,System.String)

Top method improvements (percentages):
          -2 (-13.33% of base) : 217015.dasm - System.IO.Ports.SerialPort:GetElapsedTime(int,int):int
          -6 (-10.34% of base) : 79129.dasm - System.Number:Int32ToHexChars(long,int,int,int):long
          -3 (-9.38% of base) : 79568.dasm - System.Int64:System.INumber<System.Int64>.Abs(long):long
          -3 (-9.38% of base) : 79491.dasm - System.IntPtr:System.INumber<nint>.Abs(long):long
          -3 (-9.38% of base) : 82571.dasm - System.Math:Abs(long):long
          -3 (-9.38% of base) : 82572.dasm - System.Math:Abs(long):long
          -6 (-8.82% of base) : 79127.dasm - System.Number:UInt32ToDecChars(long,int,int):long
          -6 (-8.57% of base) : 79126.dasm - System.Number:UInt32ToDecChars(long,int,int):long
          -6 (-8.33% of base) : 200414.dasm - System.Numerics.BigInteger:GetDiffLength(System.UInt32[],System.UInt32[],int):int
          -6 (-8.00% of base) : 210775.dasm - System.IO.Compression.ZipArchiveEntry:GetFileName_Unix(System.String):System.String
          -6 (-7.32% of base) : 200627.dasm - Number:Int32ToDecChars(long,byref,int,int)
          -2 (-7.14% of base) : 79638.dasm - System.Int32:System.INumber<System.Int32>.Abs(int):int
          -2 (-7.14% of base) : 82573.dasm - System.Math:Abs(int):int
          -2 (-7.14% of base) : 72866.dasm - System.Threading.PortableThreadPool:GetAvailableThreads():int:this
          -6 (-6.90% of base) : 210776.dasm - System.IO.Compression.ZipArchiveEntry:GetFileName_Windows(System.String):System.String
          -6 (-6.82% of base) : 181700.dasm - System.Security.Cryptography.Pkcs.Pkcs12Kdf:AddPlusOne(System.Span`1[System.Byte],System.Span`1[System.Byte])
          -6 (-6.82% of base) : 184949.dasm - System.Security.Cryptography.Pkcs.Pkcs12Kdf:AddPlusOne(System.Span`1[System.Byte],System.Span`1[System.Byte])
          -6 (-6.82% of base) : 213458.dasm - System.Security.Cryptography.Pkcs.Pkcs12Kdf:AddPlusOne(System.Span`1[System.Byte],System.Span`1[System.Byte])
          -6 (-6.19% of base) : 200605.dasm - System.Numerics.BigIntegerCalculator:Divide(System.ReadOnlySpan`1[System.UInt32],int,System.Span`1[System.UInt32])
         -12 (-6.09% of base) : 63997.dasm - System.Collections.Hashtable:ContainsValue(System.Object):bool:this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 45512425 (overridden on cmd)
Total bytes of diff: 45510267 (overridden on cmd)
Total bytes of delta: -2158 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          22 : 16849.dasm (2.51% of base)
          11 : 216152.dasm (0.38% of base)
          10 : 16850.dasm (0.98% of base)
           7 : 16848.dasm (0.97% of base)
           6 : 203522.dasm (0.33% of base)
           5 : 105904.dasm (1.05% of base)
           5 : 215971.dasm (7.14% of base)
           4 : 216721.dasm (0.76% of base)

Top file improvements (bytes):
         -31 : 203494.dasm (-1.88% of base)
         -31 : 203536.dasm (-1.88% of base)
         -23 : 226703.dasm (-11.62% of base)
         -22 : 117539.dasm (-0.91% of base)
         -18 : 159392.dasm (-0.34% of base)
         -18 : 193645.dasm (-22.22% of base)
         -16 : 84953.dasm (-1.08% of base)
         -15 : 203463.dasm (-0.92% of base)
         -13 : 148870.dasm (-1.22% of base)
         -13 : 21898.dasm (-1.13% of base)
         -12 : 211260.dasm (-7.79% of base)
         -12 : 22538.dasm (-0.32% of base)
         -12 : 55879.dasm (-0.50% of base)
         -12 : 3678.dasm (-2.63% of base)
         -12 : 112587.dasm (-1.87% of base)
         -11 : 21911.dasm (-1.80% of base)
         -11 : 21942.dasm (-1.78% of base)
         -10 : 105903.dasm (-2.08% of base)
         -10 : 139762.dasm (-0.69% of base)
         -10 : 215932.dasm (-2.14% of base)

669 total files with Code Size differences (661 improved, 8 regressed), 6 unchanged.

Top method regressions (bytes):
          22 ( 2.51% of base) : 16849.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,ushort,int):int
          11 ( 0.38% of base) : 216152.dasm - System.Numerics.BigNumber:FormatBigInteger(bool,System.Numerics.BigInteger,System.String,System.ReadOnlySpan`1[Char],System.Globalization.NumberFormatInfo,System.Span`1[Char],byref,byref):System.String
          10 ( 0.98% of base) : 16850.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,ushort,ushort,int):int
           7 ( 0.97% of base) : 16848.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,int):int
           6 ( 0.33% of base) : 203522.dasm - System.Buffers.SequenceReader`1[Vector`1][System.Numerics.Vector`1[System.Single]]:TryReadToSlow(byref,System.Numerics.Vector`1[Single],System.Numerics.Vector`1[Single],int,bool):bool:this
           5 ( 1.05% of base) : 105904.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
           5 ( 7.14% of base) : 215971.dasm - System.Numerics.BigIntegerCalculator:Remainder(System.ReadOnlySpan`1[UInt32],int):int
           4 ( 0.76% of base) : 216721.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

Top method improvements (bytes):
         -31 (-1.88% of base) : 203494.dasm - System.Buffers.SequenceReader`1[Int32][System.Int32]:TryReadToSlow(byref,int,int,int,bool):bool:this
         -31 (-1.88% of base) : 203536.dasm - System.Buffers.SequenceReader`1[Int64][System.Int64]:TryReadToSlow(byref,long,long,int,bool):bool:this
         -23 (-11.62% of base) : 226703.dasm - System.Text.RegularExpressions.Symbolic.BV:CompareTo(System.Object):int:this
         -22 (-0.91% of base) : 117539.dasm - System.Drawing.Icon:Initialize(int,int):this
         -18 (-0.34% of base) : 159392.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeAutoFieldLayout(Internal.TypeSystem.MetadataType,int):Internal.TypeSystem.ComputedInstanceFieldLayout:this
         -18 (-22.22% of base) : 193645.dasm - System.IO.Compression.ZipArchiveEntry:GetFileName_Unix(System.String):System.String
         -16 (-1.08% of base) : 84953.dasm - Microsoft.Diagnostics.Tracing.StackSources.LinuxPerfScriptEventParser:ReadFramesForSample(System.String,int,int,Microsoft.Diagnostics.Tracing.StackSources.Frame,Microsoft.Diagnostics.Tracing.Utilities.FastStream):System.Collections.Generic.List`1[[Microsoft.Diagnostics.Tracing.StackSources.Frame, Microsoft.Diagnostics.Tracing.TraceEvent, Version=2.0.65.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]:this
         -15 (-0.92% of base) : 203463.dasm - System.Buffers.SequenceReader`1[Byte][System.Byte]:TryReadToSlow(byref,ubyte,ubyte,int,bool):bool:this
         -13 (-1.22% of base) : 148870.dasm - Enumerator:MoveNext():bool:this
         -13 (-1.13% of base) : 21898.dasm - System.Collections.Generic.HashSet`1[Byte][System.Byte]:AddIfNotPresent(ubyte,byref):bool:this
         -12 (-0.32% of base) : 22538.dasm - Microsoft.CodeAnalysis.CSharp.Binder:BindQuery(Microsoft.CodeAnalysis.CSharp.Syntax.QueryExpressionSyntax,Microsoft.CodeAnalysis.DiagnosticBag):Microsoft.CodeAnalysis.CSharp.BoundExpression:this
         -12 (-0.50% of base) : 55879.dasm - Microsoft.CodeAnalysis.VisualBasic.LocalRewriter:VisitUsingStatement(Microsoft.CodeAnalysis.VisualBasic.BoundUsingStatement):Microsoft.CodeAnalysis.VisualBasic.BoundNode:this
         -12 (-2.63% of base) : 3678.dasm - Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter:build@610-1(System.Type,System.Linq.Expressions.Expression[]):System.Linq.Expressions.Expression
         -12 (-1.87% of base) : 112587.dasm - System.Data.SqlTypes.SqlDecimal:Round(System.Data.SqlTypes.SqlDecimal,int,bool):System.Data.SqlTypes.SqlDecimal
         -12 (-7.79% of base) : 211260.dasm - System.Numerics.Tensors.ArrayUtilities:GetStrides(System.ReadOnlySpan`1[Int32],bool):System.Int32[]
         -11 (-1.80% of base) : 21911.dasm - System.Collections.Generic.HashSet`1[Byte][System.Byte]:FindItemIndex(ubyte):int:this
         -11 (-1.78% of base) : 21942.dasm - System.Collections.Generic.HashSet`1[Int16][System.Int16]:FindItemIndex(short):int:this
         -10 (-2.08% of base) : 105903.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int32TryParse(System.Char[],int,int,byref):int
         -10 (-2.14% of base) : 215932.dasm - Number:FormatExponent(byref,System.Globalization.NumberFormatInfo,int,ushort,int,bool)
         -10 (-0.69% of base) : 139762.dasm - System.Xml.Schema.XmlSchemaSet:Compile():this

Top method regressions (percentages):
           5 ( 7.14% of base) : 215971.dasm - System.Numerics.BigIntegerCalculator:Remainder(System.ReadOnlySpan`1[UInt32],int):int
          22 ( 2.51% of base) : 16849.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,ushort,int):int
           5 ( 1.05% of base) : 105904.dasm - Newtonsoft.Json.Utilities.ConvertUtils:Int64TryParse(System.Char[],int,int,byref):int
          10 ( 0.98% of base) : 16850.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,ushort,ushort,int):int
           7 ( 0.97% of base) : 16848.dasm - System.SpanHelpers:IndexOfAny(byref,ushort,ushort,ushort,int):int
           4 ( 0.76% of base) : 216721.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
          11 ( 0.38% of base) : 216152.dasm - System.Numerics.BigNumber:FormatBigInteger(bool,System.Numerics.BigInteger,System.String,System.ReadOnlySpan`1[Char],System.Globalization.NumberFormatInfo,System.Span`1[Char],byref,byref):System.String
           6 ( 0.33% of base) : 203522.dasm - System.Buffers.SequenceReader`1[Vector`1][System.Numerics.Vector`1[System.Single]]:TryReadToSlow(byref,System.Numerics.Vector`1[Single],System.Numerics.Vector`1[Single],int,bool):bool:this

Top method improvements (percentages):
         -18 (-22.22% of base) : 193645.dasm - System.IO.Compression.ZipArchiveEntry:GetFileName_Unix(System.String):System.String
          -2 (-13.33% of base) : 196152.dasm - System.IO.Ports.SerialPort:GetElapsedTime(int,int):int
         -23 (-11.62% of base) : 226703.dasm - System.Text.RegularExpressions.Symbolic.BV:CompareTo(System.Object):int:this
          -3 (-9.68% of base) : 14017.dasm - -cctor@6149-9:Invoke(long):long:this
          -3 (-9.68% of base) : 18769.dasm - System.Runtime.Intrinsics.Scalar`1[Int64][System.Int64]:Abs(long):long
         -12 (-7.79% of base) : 211260.dasm - System.Numerics.Tensors.ArrayUtilities:GetStrides(System.ReadOnlySpan`1[Int32],bool):System.Int32[]
          -2 (-7.41% of base) : 14005.dasm - -cctor@6148-7:Invoke(int):int:this
          -2 (-7.41% of base) : 18728.dasm - System.Runtime.Intrinsics.Scalar`1[Int32][System.Int32]:Abs(int):int
          -6 (-7.32% of base) : 215925.dasm - Number:Int32ToDecChars(long,byref,int,int)
          -4 (-6.90% of base) : 43161.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.GeneratedNames:MakeIteratorFinallyMethodName(int):System.String
          -2 (-5.41% of base) : 148876.dasm - Enumerator:AddColumns(ushort,int):ushort:this
          -2 (-4.76% of base) : 205909.dasm - System.Net.Mail.QuotedPairReader:CountBackslashes(System.String,int):int
          -2 (-4.65% of base) : 198687.dasm - TakeOrSkipQueryOperatorResults[__Canon][System.__Canon]:get_ElementsCount():int:this
          -2 (-4.65% of base) : 198692.dasm - TakeOrSkipQueryOperatorResults[Byte][System.Byte]:get_ElementsCount():int:this
          -4 (-4.44% of base) : 80786.dasm - Roslyn.Utilities.FileNameUtilities:IndexOfFileName(System.String):int
          -4 (-4.44% of base) : 147325.dasm - System.Reflection.Metadata.PathUtilities:IndexOfFileName(System.String):int
          -4 (-4.40% of base) : 137128.dasm - System.Xml.DocumentXPathNavigator:MoveToNextNamespaceLocal(System.Xml.XmlAttributeCollection,byref):bool
          -4 (-4.26% of base) : 76978.dasm - Microsoft.CodeAnalysis.XmlLocation:Create(System.Xml.XmlException,System.String):Microsoft.CodeAnalysis.XmlLocation
          -4 (-4.17% of base) : 111281.dasm - System.Data.DataTable:get_LiveIndexes():System.Collections.Generic.List`1[[System.Data.Index, System.Data.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]:this
          -4 (-3.92% of base) : 129383.dasm - System.Runtime.Serialization.ScopedKnownTypes:GetDataContract(System.Xml.XmlQualifiedName):System.Runtime.Serialization.DataContract:this

669 total methods with Code Size differences (661 improved, 8 regressed), 6 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 113834739 (overridden on cmd)
Total bytes of diff: 113832046 (overridden on cmd)
Total bytes of delta: -2693 (-0.00 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           1 : 123228.dasm (0.51% of base)

Top file improvements (bytes):
         -40 : 333991.dasm (-1.53% of base)
         -24 : 242632.dasm (-1.21% of base)
         -24 : 333924.dasm (-0.71% of base)
         -24 : 344041.dasm (-0.45% of base)
         -24 : 334122.dasm (-1.14% of base)
         -22 : 9237.dasm (-9.24% of base)
         -21 : 269372.dasm (-0.54% of base)
         -20 : 333992.dasm (-0.61% of base)
         -20 : 333972.dasm (-0.71% of base)
         -18 : 21631.dasm (-0.30% of base)
         -18 : 242630.dasm (-1.19% of base)
         -18 : 334128.dasm (-0.46% of base)
         -18 : 187910.dasm (-0.80% of base)
         -18 : 242653.dasm (-2.54% of base)
         -18 : 70560.dasm (-0.80% of base)
         -17 : 242642.dasm (-1.52% of base)
         -17 : 325415.dasm (-1.18% of base)
         -16 : 333923.dasm (-1.38% of base)
         -16 : 334123.dasm (-0.50% of base)
         -14 : 206344.dasm (-1.67% of base)

685 total files with Code Size differences (684 improved, 1 regressed), 7 unchanged.

Top method regressions (bytes):
           1 ( 0.51% of base) : 123228.dasm - Microsoft.Build.Shared.TypeLoader:IsPartialTypeNameMatch(System.String,System.String):bool

Top method improvements (bytes):
         -40 (-1.53% of base) : 333991.dasm - System.Text.RegularExpressions.Generator.RegexGenerator:<EmitFindFirstChar>g__EmitAnchors|7_0(byref)
         -24 (-1.14% of base) : 334122.dasm - <>c__DisplayClass10_0:<EmitSimplifiedGo>g__EmitAnchors|22(System.Text.RegularExpressions.RegexNode):this
         -24 (-0.71% of base) : 333924.dasm - System.Text.RegularExpressions.Generator.RegexGenerator:<EmitFindFirstChar>g__EmitLeadingCharacter_LeftToRight|7_4(byref)
         -24 (-0.45% of base) : 344041.dasm - System.Xml.Tests.ToTypeTests:ToType43():int:this
         -24 (-1.21% of base) : 242632.dasm - Visitor:FormatObjectMembers(Builder,System.Object,System.Reflection.TypeInfo,bool,bool):this
         -22 (-9.24% of base) : 9237.dasm - Microsoft.CodeAnalysis.Formatting.AbstractTriviaFormatter:GetInsertionSpan(Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1[TextChange]):Microsoft.CodeAnalysis.Text.TextSpan:this
         -21 (-0.54% of base) : 269372.dasm - System.Collections.Immutable.Tests.ImmutableListTest:ReplaceTest():this
         -20 (-0.61% of base) : 333992.dasm - System.Text.RegularExpressions.Generator.RegexGenerator:<EmitFindFirstChar>g__EmitBoyerMoore|7_1(System.Text.RegularExpressions.RegexBoyerMoore,byref)
         -20 (-0.71% of base) : 333972.dasm - System.Text.RegularExpressions.Generator.RegexGenerator:EmitCompleteGo(System.CodeDom.Compiler.IndentedTextWriter,RegexMethod,System.String)
         -18 (-0.46% of base) : 334128.dasm - <>c__DisplayClass10_0:<EmitSimplifiedGo>g__EmitSingleCharAtomicLoop|27(System.Text.RegularExpressions.RegexNode,bool):this
         -18 (-0.30% of base) : 21631.dasm - <CopyTo_Array_TestData>d__15:MoveNext():bool:this
         -18 (-2.54% of base) : 242653.dasm - FormattedMember:AppendAsCollectionEntry(Builder):bool:this
         -18 (-0.80% of base) : 187910.dasm - System.Tests.StringTests:TrimCharacterMultipleTimes()
         -18 (-0.80% of base) : 70560.dasm - System.Tests.StringTests:TrimCharacterMultipleTimes()
         -18 (-1.19% of base) : 242630.dasm - Visitor:FormatObjectRecursive(Builder,System.Object,bool,byref):Builder:this
         -17 (-1.18% of base) : 325415.dasm - System.Numerics.Tests.ComparisonTest:GetRandomInputForComparison(System.Random,byref,byref):int
         -17 (-1.52% of base) : 242642.dasm - Visitor:FormatMultidimensionalArrayElements(Builder,System.Array,bool):this
         -16 (-0.50% of base) : 334123.dasm - <>c__DisplayClass10_0:<EmitSimplifiedGo>g__EmitMultiChar|23(System.Text.RegularExpressions.RegexNode,bool):this
         -16 (-1.38% of base) : 333923.dasm - System.Text.RegularExpressions.Generator.RegexGenerator:<EmitFindFirstChar>g__EmitLeadingCharacter_RightToLeft|7_3(byref)
         -14 (-1.67% of base) : 206344.dasm - System.Xml.Tests.TCAttributeXmlDeclaration:TAXmlDecl_4():int:this

Top method regressions (percentages):
           1 ( 0.51% of base) : 123228.dasm - Microsoft.Build.Shared.TypeLoader:IsPartialTypeNameMatch(System.String,System.String):bool

Top method improvements (percentages):
          -4 (-11.11% of base) : 57592.dasm - GenClass`1[Byte][System.Byte]:WithinTwo(int,int):bool
          -4 (-11.11% of base) : 52309.dasm - System.Linq.Expressions.Tests.SwitchTests:WithinTen(int,int):bool
          -4 (-10.81% of base) : 57591.dasm - GenClass`1[__Canon][System.__Canon]:WithinTwo(int,int):bool
          -6 (-10.71% of base) : 111376.dasm - DoNotSizeInt64@410-5:Invoke(long):bool:this
          -6 (-10.71% of base) : 111365.dasm - DontSizeInt64@402-5:Invoke(long):bool:this
          -5 (-10.00% of base) : 271334.dasm - System.Collections.Tests.Comparer_AbsOfInt:Compare(int,int):int:this
          -5 (-10.00% of base) : 19439.dasm - System.Collections.Tests.Comparer_AbsOfInt:Compare(int,int):int:this
          -5 (-10.00% of base) : 266127.dasm - System.Collections.Tests.Comparer_AbsOfInt:Compare(int,int):int:this
          -5 (-10.00% of base) : 268314.dasm - System.Collections.Tests.Comparer_AbsOfInt:Compare(int,int):int:this
          -5 (-10.00% of base) : 273120.dasm - System.Collections.Tests.Comparer_AbsOfInt:Compare(int,int):int:this
          -3 (-9.68% of base) : 309861.dasm - System.Numerics.Tests.Util:Abs(long):long
          -3 (-9.68% of base) : 321393.dasm - System.Tests.NumberHelper`1[Int64][System.Int64]:Abs(long):long
          -5 (-9.62% of base) : 19440.dasm - System.Collections.Tests.Comparer_AbsOfInt:Equals(int,int):bool:this
          -5 (-9.62% of base) : 271335.dasm - System.Collections.Tests.Comparer_AbsOfInt:Equals(int,int):bool:this
          -5 (-9.62% of base) : 268315.dasm - System.Collections.Tests.Comparer_AbsOfInt:Equals(int,int):bool:this
          -5 (-9.62% of base) : 266128.dasm - System.Collections.Tests.Comparer_AbsOfInt:Equals(int,int):bool:this
          -5 (-9.62% of base) : 273121.dasm - System.Collections.Tests.Comparer_AbsOfInt:Equals(int,int):bool:this
         -22 (-9.24% of base) : 9237.dasm - Microsoft.CodeAnalysis.Formatting.AbstractTriviaFormatter:GetInsertionSpan(Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1[TextChange]):Microsoft.CodeAnalysis.Text.TextSpan:this
          -4 (-8.00% of base) : 111329.dasm - Int32@343-4:Invoke(int):bool:this
          -3 (-7.89% of base) : 319856.dasm - System.Reflection.Tests.ClassWithVarArgMethod:ReturnAndSetField(int,System.Int32[]):int:this

685 total methods with Code Size differences (684 improved, 1 regressed), 7 unchanged.


@kunalspathak
Copy link
Member

kunalspathak commented Nov 9, 2021

A lot of [align X bytes] were optimized out, but in some cases the change actually forced the insertion of alignment.

One way to verify the real impact would be turning off loop alignment for both baseline/diff using COMPlus_JitAlignLoops=0.

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

LGTM...@tannergooding, you mind taking another look?

}

// Don't look back across IG boundaries (possible control flow)
if (emitCurIGinsCnt == 0 && ((emitCurIG->igFlags & IGF_EXTEND) == 0))
Copy link
Member

Choose a reason for hiding this comment

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

The check emitCurIGinsCnt == 0 && ((emitCurIG->igFlags & IGF_EXTEND) == 0) is becoming more and more popular (we already do it at 6 different places), can you extract this in a method?

Copy link
Member

Choose a reason for hiding this comment

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

I am ok to have a follow-up PR as Andy pointed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can do this with a follow-up PR. Happy to help.

@AndyAyersMS
Copy link
Member

Arm regex test timed out, seeing if retry will fix things.

@anthonycanino
Copy link
Contributor Author

@AndyAyersMS looks like everything passed now. Thanks for rerunning that.

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.

Will hold off merging for a while to give @tannergooding a chance to review too.

@anthonycanino
Copy link
Contributor Author

Ok, thanks for reviewing @AndyAyersMS and @kunalspathak !

@AndyAyersMS
Copy link
Member

@tannergooding do you want to look this over? If not I'll go ahead and merge.

@AndyAyersMS AndyAyersMS merged commit 99dd33b into dotnet:main Nov 12, 2021
@AndyAyersMS
Copy link
Member

@anthonycanino thanks for the contribution!

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 community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants