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

Fix CQ regression & correctness bug in morphing of long muls #53566

Merged
merged 8 commits into from
Jun 25, 2021

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Jun 2, 2021

Previously, morph was looking for the exact pattern of MUL(CAST(long <- int), CAST(long <- int)) when assessing
candidacy of GT_MUL for being marked with GTF_MUL_64RSLT and emitted as "long mul".

This worked fine, until the importer was changed to fold all casts with constant operands. This broke the pattern matching and thus all MULs in the form of (long)value * 10 started being emitted as helper calls.

This change updates morph to understand the new folded casts and in general updates the "format" of long mul from CAST * CAST to CAST * (CAST | CONST).

In the process, new helper functions have been introduced, to avoid bloating fgMorphSmpOp with the new sizeable logic.

Recognition of overflowing cases has been upgraded, and a correctness bug, where checked((long)uint.MaxValue * (long)uint.MaxValue) was wrongly treated as non-overflowing, fixed.

Additionally, the logic to emit intermediate NOPs has been changed to instead always skip morphing the casts themselves,
even when remorphing.

A new test has been added, generated via a script. The test is meant to be an outerloop one, but I am temporarily marking it Pri0 for it to run in CI.

Also, a few helpers for working with gtFlags have been added.

Diffs for this change:

Windows x86
Running asm diffs of benchmarks.run.windows.x86.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 222768
Total bytes of diff: 220093
Total bytes of delta: -2675 (-1.20% of base)
    diff is an improvement.


Top file improvements (bytes):
        -298 : 13447.dasm (-3.03% of base)
        -265 : 19727.dasm (-2.85% of base)
        -250 : 14674.dasm (-0.79% of base)
        -243 : 21662.dasm (-1.17% of base)
        -197 : 15230.dasm (-0.57% of base)
        -176 : 13430.dasm (-0.69% of base)
        -172 : 22974.dasm (-1.85% of base)
        -169 : 15250.dasm (-1.72% of base)
         -70 : 13795.dasm (-10.39% of base)
         -62 : 22688.dasm (-2.95% of base)
         -56 : 14057.dasm (-4.83% of base)
         -55 : 6211.dasm (-3.92% of base)
         -40 : 19713.dasm (-0.39% of base)
         -37 : 23755.dasm (-2.74% of base)
         -37 : 2650.dasm (-0.99% of base)
         -33 : 1986.dasm (-10.89% of base)
         -28 : 14675.dasm (-0.70% of base)
         -28 : 10969.dasm (-0.54% of base)
         -25 : 10376.dasm (-1.61% of base)
         -21 : 20640.dasm (-0.49% of base)

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

Top method improvements (bytes):
        -298 (-3.03% of base) - Jil.Deserialize.Methods:_ReadISO8601DateWithOffsetThunkReader(byref,System.Char[]):System.DateTimeOffset
        -265 (-2.85% of base) - Jil.Deserialize.Methods:_ReadISO8601DateThunkReader(byref,System.Char[]):System.DateTime
        -250 (-0.79% of base) - DynamicClass:_DynamicMethod0(byref,MicroBenchmarks.Serializers.MyEventsListerItem,int)
        -243 (-1.17% of base) - DynamicClass:_DynamicMethod0(System.IO.TextWriter,MicroBenchmarks.Serializers.IndexViewModel,int)
        -197 (-0.57% of base) - DynamicClass:_DynamicMethod0(System.IO.TextWriter,MicroBenchmarks.Serializers.MyEventsListerItem,int)
        -176 (-0.69% of base) - DynamicClass:_DynamicMethod0(byref,MicroBenchmarks.Serializers.IndexViewModel,int)
        -172 (-1.85% of base) - Jil.Deserialize.Methods:_ReadISO8601Date(System.IO.TextReader,System.Char[]):System.DateTime
        -169 (-1.72% of base) - Jil.Deserialize.Methods:_ReadISO8601DateWithOffset(System.IO.TextReader,System.Char[]):System.DateTimeOffset
         -70 (-10.39% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(Newtonsoft.Json.Utilities.StringReference,byref):bool
         -62 (-2.95% of base) - System.Xml.Schema.XsdDateTime:op_Implicit(System.Xml.Schema.XsdDateTime):System.DateTime
         -56 (-4.83% of base) - System.Number:TryNumberToDecimal(byref,byref):bool
         -55 (-3.92% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeIso(Newtonsoft.Json.Utilities.StringReference,int,byref):bool
         -40 (-0.39% of base) - DynamicClass:_DynamicMethod0(byref,MicroBenchmarks.Serializers.CollectionsOfPrimitives,int)
         -37 (-2.74% of base) - System.Xml.XmlConverter:TryParseDateTime(System.Byte[],int,int,byref):bool
         -37 (-0.99% of base) - Utf8Json.Formatters.ISO8601DateTimeOffsetFormatter:Deserialize(byref,Utf8Json.IJsonFormatterResolver):System.DateTimeOffset:this
         -33 (-10.89% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -28 (-0.70% of base) - Jil.Serialize.Methods:_CustomISO8601WithOffsetToString_ThunkWriter(byref,System.DateTime,int,int,System.Char[])
         -28 (-0.54% of base) - DynamicClass:_DynamicMethod0(System.IO.TextWriter,MicroBenchmarks.Serializers.CollectionsOfPrimitives,int)
         -25 (-1.61% of base) - System.TimeZoneInfo:CreateAdjustmentRuleFromTimeZoneInformation(byref,System.DateTime,System.DateTime,int):AdjustmentRule
         -21 (-0.49% of base) - Utf8Json.Formatters.ISO8601DateTimeFormatter:Deserialize(byref,Utf8Json.IJsonFormatterResolver):System.DateTime:this

Top method improvements (percentages):
         -33 (-10.89% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -70 (-10.39% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(Newtonsoft.Json.Utilities.StringReference,byref):bool
          -9 (-8.91% of base) - System.Globalization.HebrewCalendar:IsLeapYear(int,int):bool:this
          -9 (-7.96% of base) - System.DateTimeOffset:get_Offset():System.TimeSpan:this
         -12 (-7.89% of base) - System.Net.Http.HttpConnection:ThrowIfExceededAllowedReadLineBytes():this
         -16 (-5.76% of base) - System.Tests.Perf_DateTime:.ctor():this
          -9 (-5.73% of base) - System.DateTimeOffset:ToString():System.String:this
         -18 (-5.70% of base) - System.DateTimeOffset:System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object):this
          -9 (-5.59% of base) - System.DateTimeOffset:ToString(System.String):System.String:this
          -9 (-5.11% of base) - System.DateTimeOffset:TryFormat(System.Span`1[Char],byref,System.ReadOnlySpan`1[Char],System.IFormatProvider):bool:this
         -56 (-4.83% of base) - System.Number:TryNumberToDecimal(byref,byref):bool
          -9 (-4.64% of base) - System.Text.OSEncoding:GetMaxByteCount(int):int:this
          -9 (-4.35% of base) - System.DateTimeOffset:AddTicks(long):System.DateTimeOffset:this
          -9 (-4.21% of base) - System.DateTimeOffset:get_ClockDateTime():System.DateTime:this
          -9 (-4.15% of base) - System.DateTimeOffset:op_Addition(System.DateTimeOffset,System.TimeSpan):System.DateTimeOffset
          -9 (-4.11% of base) - System.DateTimeOffset:AddHours(double):System.DateTimeOffset:this
         -55 (-3.92% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeIso(Newtonsoft.Json.Utilities.StringReference,int,byref):bool
         -16 (-3.90% of base) - System.Tests.Perf_DateTimeOffset:.ctor():this
         -18 (-3.81% of base) - System.Runtime.Serialization.DateTimeOffsetAdapter:GetDateTimeOffset(System.Runtime.Serialization.DateTimeOffsetAdapter):System.DateTimeOffset
         -14 (-3.46% of base) - System.Text.Json.JsonHelpers:TryCreateDateTimeOffset(System.DateTime,byref,byref):bool

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

Running asm diffs of coreclr_tests.pmi.windows.x86.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 6480
Total bytes of diff: 6410
Total bytes of delta: -70 (-1.08% of base)
    diff is an improvement.


Top method regressions (bytes):
          27 ( 4.16% of base) - JitTest.Test:Main():int
          27 ( 4.16% of base) - JitTest.Test:Main():int
          18 ( 4.03% of base) - JitTest.Test:Main():int

Top method improvements (bytes):
         -28 (-2.87% of base) - Test:TestAllocInNoGCRegion(int,int,bool):bool
         -16 (-3.12% of base) - FinalizerTest:allocateInFinalizerTest():bool:this
         -11 (-11.70% of base) - SP2a:Foo(int,S):long
         -11 (-11.70% of base) - SP2b:Foo(int,S):long
         -10 (-1.19% of base) - ExchangeAdd.InterlockedAddInt:Main(System.String[]):int
         -10 (-12.50% of base) - AA:Static2(System.String[]):TestEnum[]
          -9 (-7.26% of base) - SP2c:Foo(int,long,S):long
          -9 (-4.64% of base) - System.Text.OSEncoding:GetMaxByteCount(int):int:this
          -9 (-22.50% of base) - LargeObject:get_Size():long:this
          -9 (-18.37% of base) - SP2:Foo(S):long
          -8 (-1.14% of base) - Repro:Main():int
          -5 (-1.30% of base) - JitTest.Test:Main():int
          -5 (-1.30% of base) - JitTest.Test:Main():int
          -2 (-1.74% of base) - CC:Static3(short):float

Top method regressions (percentages):
          27 ( 4.16% of base) - JitTest.Test:Main():int
          27 ( 4.16% of base) - JitTest.Test:Main():int
          18 ( 4.03% of base) - JitTest.Test:Main():int

Top method improvements (percentages):
          -9 (-22.50% of base) - LargeObject:get_Size():long:this
          -9 (-18.37% of base) - SP2:Foo(S):long
         -10 (-12.50% of base) - AA:Static2(System.String[]):TestEnum[]
         -11 (-11.70% of base) - SP2a:Foo(int,S):long
         -11 (-11.70% of base) - SP2b:Foo(int,S):long
          -9 (-7.26% of base) - SP2c:Foo(int,long,S):long
          -9 (-4.64% of base) - System.Text.OSEncoding:GetMaxByteCount(int):int:this
         -16 (-3.12% of base) - FinalizerTest:allocateInFinalizerTest():bool:this
         -28 (-2.87% of base) - Test:TestAllocInNoGCRegion(int,int,bool):bool
          -2 (-1.74% of base) - CC:Static3(short):float
          -5 (-1.30% of base) - JitTest.Test:Main():int
          -5 (-1.30% of base) - JitTest.Test:Main():int
         -10 (-1.19% of base) - ExchangeAdd.InterlockedAddInt:Main(System.String[]):int
          -8 (-1.14% of base) - Repro:Main():int

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

Running asm diffs of libraries.crossgen.windows.x86.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 38967
Total bytes of diff: 37400
Total bytes of delta: -1567 (-4.02% of base)
    diff is an improvement.


Top method regressions (bytes):
           3 ( 0.25% of base) - <ReadHeadersAsync>d__43:MoveNext():this

Top method improvements (bytes):
         -64 (-5.58% of base) - System.Number:TryNumberToDecimal(byref,byref):bool
         -48 (-12.40% of base) - System.Globalization.TimeSpanParse:TryTimeToTicks(bool,TimeSpanToken,TimeSpanToken,TimeSpanToken,TimeSpanToken,TimeSpanToken,byref):bool
         -36 (-11.92% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -32 (-14.68% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -31 (-6.75% of base) - System.DateTimeParse:ParseTimeZoneOffset(byref,int,byref):bool
         -30 (-6.56% of base) - StringParser:ParseTime(byref,byref):bool:this
         -29 (-14.87% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -28 (-1.80% of base) - System.TimeZoneInfo:CreateAdjustmentRuleFromTimeZoneInformation(byref,System.DateTime,System.DateTime,int):AdjustmentRule
         -28 (-25.23% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -26 (-8.05% of base) - System.Diagnostics.EventLogInternal:ModifyOverflowPolicy(int,int):this
         -25 (-15.62% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -25 (-12.63% of base) - System.Globalization.InternalGlobalizationHelper:TimeToTicks(int,int,int):long
         -22 (-3.06% of base) - System.DateTimeParse:ParseTimeZone(byref,byref):bool
         -21 (-1.31% of base) - System.DateTimeParse:ParseFormatO(System.ReadOnlySpan`1[Char],byref):bool
         -21 (-12.65% of base) - System.TimeSpan:.ctor(int,int,int):this
         -21 (-5.16% of base) - System.Buffers.Text.Utf8Parser:TryCreateDateTimeOffset(System.DateTime,bool,int,int,byref):bool
         -20 (-3.85% of base) - Internal.Cryptography.TripleDesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -20 (-6.27% of base) - System.DateTimeOffset:System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object):this
         -20 (-2.16% of base) - DecCalc:VarDecFromR4(float,byref)
         -20 (-3.28% of base) - Internal.Cryptography.DesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this

Top method regressions (percentages):
           3 ( 0.25% of base) - <ReadHeadersAsync>d__43:MoveNext():this

Top method improvements (percentages):
         -14 (-33.33% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -19 (-32.76% of base) - System.Data.SqlTypes.SqlMoney:.ctor(int):this
         -28 (-25.23% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -15 (-17.65% of base) - System.Xml.BinXmlDateTime:GetKatmaiTimeZoneTicks(System.Byte[],int):long
         -25 (-15.62% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -29 (-14.87% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -13 (-14.77% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_SendTimeout():System.TimeSpan:this
         -13 (-14.77% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingKeepAliveTimeout():System.TimeSpan:this
         -13 (-14.77% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingWaitTimeout():System.TimeSpan:this
         -32 (-14.68% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -13 (-13.00% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt32):System.Data.SqlTypes.SqlMoney
         -13 (-12.87% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlByte):System.Data.SqlTypes.SqlMoney
         -13 (-12.87% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt16):System.Data.SqlTypes.SqlMoney
         -21 (-12.65% of base) - System.TimeSpan:.ctor(int,int,int):this
         -25 (-12.63% of base) - System.Globalization.InternalGlobalizationHelper:TimeToTicks(int,int,int):long
         -17 (-12.59% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -48 (-12.40% of base) - System.Globalization.TimeSpanParse:TryTimeToTicks(bool,TimeSpanToken,TimeSpanToken,TimeSpanToken,TimeSpanToken,TimeSpanToken,byref):bool
         -36 (-11.92% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
          -9 (-11.54% of base) - System.DateTime:TimeToTicks(int,int,int):long
         -13 (-11.30% of base) - System.Data.SqlTypes.SqlMoney:op_Explicit(System.Data.SqlTypes.SqlBoolean):System.Data.SqlTypes.SqlMoney

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

Running asm diffs of libraries.crossgen2.windows.x86.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 50308
Total bytes of diff: 48838
Total bytes of delta: -1470 (-2.92% of base)
    diff is an improvement.


Top method regressions (bytes):
          68 ( 5.84% of base) - <ReadHeadersAsync>d__43:MoveNext():this
          14 ( 1.68% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (bytes):
         -60 (-5.33% of base) - System.Number:TryNumberToDecimal(byref,byref):bool
         -48 (-12.40% of base) - System.Globalization.TimeSpanParse:TryTimeToTicks(bool,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,byref):bool
         -36 (-12.04% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -32 (-14.61% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -31 (-6.75% of base) - System.DateTimeParse:ParseTimeZoneOffset(byref,int,byref):bool
         -30 (-6.56% of base) - StringParser:ParseTime(byref,byref):bool:this
         -28 (-25.23% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -28 (-1.80% of base) - System.TimeZoneInfo:CreateAdjustmentRuleFromTimeZoneInformation(byref,System.DateTime,System.DateTime,int):System.TimeZoneInfo+AdjustmentRule
         -26 (-8.25% of base) - System.Diagnostics.EventLogInternal:ModifyOverflowPolicy(int,int):this
         -25 (-12.82% of base) - System.Globalization.InternalGlobalizationHelper:TimeToTicks(int,int,int):long
         -25 (-15.62% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -22 (-3.05% of base) - System.DateTimeParse:ParseTimeZone(byref,byref):bool
         -21 (-5.15% of base) - System.Buffers.Text.Utf8Parser:TryCreateDateTimeOffset(System.DateTime,bool,int,int,byref):bool
         -21 (-12.65% of base) - System.TimeSpan:.ctor(int,int,int):this
         -21 (-1.32% of base) - System.DateTimeParse:ParseFormatO(System.ReadOnlySpan`1[System.Char],byref):bool
         -20 (-3.45% of base) - Internal.Cryptography.DesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -20 (-6.25% of base) - System.DateTimeOffset:System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object):this
         -20 (-4.26% of base) - System.DateTimeOffset:EqualsExact(System.DateTimeOffset):bool:this
         -20 (-3.24% of base) - System.Buffers.Text.Utf8Formatter:TryFormat(System.DateTimeOffset,System.Span`1[System.Byte],byref,System.Buffers.StandardFormat):bool
         -20 (-2.36% of base) - DecCalc:VarDecFromR4(float,byref)

Top method regressions (percentages):
          68 ( 5.84% of base) - <ReadHeadersAsync>d__43:MoveNext():this
          14 ( 1.68% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (percentages):
         -14 (-33.33% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -19 (-32.76% of base) - System.Data.SqlTypes.SqlMoney:.ctor(int):this
         -28 (-25.23% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -15 (-17.44% of base) - System.Xml.BinXmlDateTime:GetKatmaiTimeZoneTicks(System.Byte[],int):long
         -25 (-15.62% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -13 (-14.77% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_SendTimeout():System.TimeSpan:this
         -13 (-14.77% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingWaitTimeout():System.TimeSpan:this
         -13 (-14.77% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingKeepAliveTimeout():System.TimeSpan:this
         -32 (-14.61% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -13 (-13.00% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt32):System.Data.SqlTypes.SqlMoney
         -13 (-12.87% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt16):System.Data.SqlTypes.SqlMoney
         -13 (-12.87% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlByte):System.Data.SqlTypes.SqlMoney
         -25 (-12.82% of base) - System.Globalization.InternalGlobalizationHelper:TimeToTicks(int,int,int):long
         -21 (-12.65% of base) - System.TimeSpan:.ctor(int,int,int):this
         -17 (-12.50% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -48 (-12.40% of base) - System.Globalization.TimeSpanParse:TryTimeToTicks(bool,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,byref):bool
         -36 (-12.04% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
          -9 (-11.54% of base) - System.DateTime:TimeToTicks(int,int,int):long
         -13 (-11.30% of base) - System.Data.SqlTypes.SqlMoney:op_Explicit(System.Data.SqlTypes.SqlBoolean):System.Data.SqlTypes.SqlMoney
         -17 (-10.69% of base) - System.Speech.Internal.Synthesis.AudioDeviceOut:get_Duration():System.TimeSpan:this

104 total methods with Code Size differences (102 improved, 2 regressed), 0 unchanged.

Running asm diffs of libraries.pmi.windows.x86.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 74388
Total bytes of diff: 72792
Total bytes of delta: -1596 (-2.15% of base)
    diff is an improvement.


Top method regressions (bytes):
          20 ( 1.28% of base) - <ReadHeadersAsync>d__43:MoveNext():this
           4 ( 0.46% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (bytes):
         -70 (-4.20% of base) - System.Xml.Schema.XsdDateTime:op_Implicit(System.Xml.Schema.XsdDateTime):System.DateTimeOffset
         -70 (-10.14% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(Newtonsoft.Json.Utilities.StringReference,byref):bool
         -70 (-10.25% of base) - Newtonsoft.Json.Bson.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(System.String,byref):bool
         -62 (-2.92% of base) - System.Xml.Schema.XsdDateTime:op_Implicit(System.Xml.Schema.XsdDateTime):System.DateTime
         -58 (-4.06% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeIso(Newtonsoft.Json.Utilities.StringReference,int,byref):bool
         -58 (-4.19% of base) - Newtonsoft.Json.Bson.Utilities.DateTimeUtils:TryParseDateTimeIso(System.String,int,byref):bool
         -53 (-1.43% of base) - System.Formats.Asn1.AsnDecoder:ParseGeneralizedTime(int,System.ReadOnlySpan`1[Byte]):System.DateTimeOffset
         -40 (-6.43% of base) - System.Xml.Schema.XsdDateTime:ToZulu():System.DateTime:this
         -39 (-0.81% of base) - System.Data.FunctionNode:EvalFunction(int,System.Object[],System.Data.DataRow,int):System.Object:this
         -37 (-2.74% of base) - System.Xml.XmlConverter:TryParseDateTime(System.Byte[],int,int,byref):bool
         -29 (-8.10% of base) - System.Net.Mime.SmtpDateTime:TryParseTimeZoneString(System.String,byref):bool:this
         -28 (-14.43% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -27 (-4.55% of base) - System.ServiceModel.Syndication.Atom10FeedFormatter:AsString(System.DateTimeOffset):System.String:this
         -27 (-3.98% of base) - System.ServiceModel.Syndication.Rss20FeedFormatter:AsString(System.DateTimeOffset):System.String:this
         -27 (-1.32% of base) - System.ComponentModel.DateTimeOffsetConverter:ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type):System.Object:this
         -26 (-23.85% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -25 (-7.60% of base) - System.Diagnostics.EventLogInternal:ModifyOverflowPolicy(int,int):this
         -23 (-10.31% of base) - System.Data.ProviderBase.DbBuffer:ReadTime(int):System.TimeSpan:this
         -23 (-10.31% of base) - System.Data.ProviderBase.DbBuffer:ReadTime(int):System.TimeSpan:this
         -20 (-4.20% of base) - System.Runtime.Serialization.DateTimeOffsetAdapter:GetDateTimeOffset(System.Runtime.Serialization.DateTimeOffsetAdapter):System.DateTimeOffset

Top method regressions (percentages):
          20 ( 1.28% of base) - <ReadHeadersAsync>d__43:MoveNext():this
           4 ( 0.46% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (percentages):
         -13 (-31.71% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -18 (-31.58% of base) - System.Data.SqlTypes.SqlMoney:.ctor(int):this
         -26 (-23.85% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -14 (-22.95% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingWaitTimeout():System.TimeSpan:this
         -14 (-22.95% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_SendTimeout():System.TimeSpan:this
         -14 (-22.95% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingKeepAliveTimeout():System.TimeSpan:this
         -14 (-16.67% of base) - System.Xml.BinXmlDateTime:GetKatmaiTimeZoneTicks(System.Byte[],int):long
         -28 (-14.43% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -16 (-12.12% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -14 (-11.02% of base) - Microsoft.VisualBasic.DateAndTime:TimeSerial(int,int,int):System.DateTime
         -12 (-10.71% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt32):System.Data.SqlTypes.SqlMoney
         -12 (-10.62% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt16):System.Data.SqlTypes.SqlMoney
         -12 (-10.62% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlByte):System.Data.SqlTypes.SqlMoney
         -23 (-10.31% of base) - System.Data.ProviderBase.DbBuffer:ReadTime(int):System.TimeSpan:this
         -23 (-10.31% of base) - System.Data.ProviderBase.DbBuffer:ReadTime(int):System.TimeSpan:this
         -12 (-10.26% of base) - System.Speech.Internal.Synthesis.AudioDeviceOut:get_Duration():System.TimeSpan:this
         -12 (-10.26% of base) - System.Speech.Internal.Synthesis.AudioFileOut:get_Duration():System.TimeSpan:this
         -70 (-10.25% of base) - Newtonsoft.Json.Bson.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(System.String,byref):bool
         -70 (-10.14% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(Newtonsoft.Json.Utilities.StringReference,byref):bool
         -12 (-9.45% of base) - System.Data.SqlTypes.SqlMoney:op_Explicit(System.Data.SqlTypes.SqlBoolean):System.Data.SqlTypes.SqlMoney

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

Running asm diffs of libraries_tests.pmi.windows.x86.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 372209
Total bytes of diff: 366677
Total bytes of delta: -5532 (-1.49% of base)
    diff is an improvement.


Top method regressions (bytes):
           2 ( 0.86% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime4()
           2 ( 0.83% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime1()
           2 ( 0.80% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime10()
           2 ( 0.86% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime7()
           2 ( 0.84% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime8()
           2 ( 0.81% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime5()
           2 ( 0.83% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime10()
           2 ( 0.83% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime4()

Top method improvements (bytes):
        -225 (-3.08% of base) - System.Xml.Tests.ToTypeTests:ToType57():int:this
        -190 (-1.17% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_Amsterdam()
        -171 (-5.72% of base) - <GetYear_TestData>d__0:MoveNext():bool:this
        -171 (-6.17% of base) - <GetEra_TestData>d__0:MoveNext():bool:this
        -171 (-6.17% of base) - <GetMonth_TestData>d__0:MoveNext():bool:this
        -159 (-1.08% of base) - System.Tests.TimeZoneInfoTests:IsInvalidTime()
        -154 (-1.04% of base) - System.Tests.TimeZoneInfoTests:IsDaylightSavingTime()
        -120 (-1.91% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_MiscUtc()
        -111 (-2.75% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_PerthRules()
        -110 (-2.64% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_LocalAmbiguousOffsets()
        -106 (-1.55% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToUtc()
         -99 (-2.24% of base) - System.Tests.TimeZoneInfoTests:ConverTime_DateTime_VariousSystemTimeZonesTest()
         -98 (-3.61% of base) - System.Tests.DateTimeOffsetTests:ParseExact_ToStringThenParseExactRoundtrip_Success(System.String)
         -85 (-2.23% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_UtcToLocal()
         -82 (-5.35% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_Nairobi_Invalid()
         -81 (-2.66% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_Invalid()
         -77 (-1.39% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToLocal()
         -69 (-0.78% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToSystem()
         -58 (-1.26% of base) - <ConvertToTestData>d__3:MoveNext():bool:this
         -58 (-3.77% of base) - <AddMonths_TestData>d__2:MoveNext():bool:this

Top method regressions (percentages):
           2 ( 0.86% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime4()
           2 ( 0.86% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime7()
           2 ( 0.84% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime8()
           2 ( 0.83% of base) - System.Xml.Tests.DateTimeElementContentTests:ReadElementContentAsDateTime10()
           2 ( 0.83% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime1()
           2 ( 0.83% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime4()
           2 ( 0.81% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime5()
           2 ( 0.80% of base) - System.Xml.Tests.DateTimeTests:ReadContentAsDateTime10()

Top method improvements (percentages):
         -20 (-36.36% of base) - System.Data.SqlClient.TdsParserStateObject:SetTimeoutSeconds(int):this
         -20 (-36.36% of base) - System.Data.SqlClient.TdsParserStateObject:SetTimeoutSeconds(int):this
         -13 (-31.71% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -15 (-20.00% of base) - ExtendedArray`1[Byte][System.Byte]:get_Count():long:this
         -15 (-20.00% of base) - ExtendedArray`1[__Canon][System.__Canon]:get_Count():long:this
         -24 (-16.55% of base) - NuGet.Packaging.Signing.Accuracy:GetTotalMicroseconds():System.Nullable`1[Int64]:this
         -28 (-14.43% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -29 (-12.18% of base) - genTimeZone@885-2:Invoke(int):FsCheck.Gen`1[TimeSpan]:this
         -16 (-11.85% of base) - System.Data.SqlClient.SqlBulkCopy:WriteMetaData(System.Data.SqlClient.BulkCopySimpleResultSet):this
         -16 (-11.85% of base) - System.Data.SqlClient.SqlBulkCopy:WriteMetaData(System.Data.SqlClient.BulkCopySimpleResultSet):this
         -16 (-9.70% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -16 (-9.70% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -12 (-8.51% of base) - System.Data.SqlClient.SqlSequentialStream:.ctor(System.Data.SqlClient.SqlDataReader,int):this
         -12 (-8.51% of base) - System.Data.SqlClient.SqlSequentialStream:.ctor(System.Data.SqlClient.SqlDataReader,int):this
         -14 (-8.48% of base) - <>c__DisplayClass20_0:<Ctor_InvalidMinute_ThrowsArgumentOutOfRangeException>b__0():System.Object:this
         -14 (-8.43% of base) - <>c__DisplayClass19_0:<Ctor_InvalidHour_ThrowsArgumentOutOfRangeException>b__0():System.Object:this
         -13 (-8.18% of base) - <>c__DisplayClass18_0:<Ctor_InvalidDay_ThrowsArgumentOutOfRangeException>b__2():System.Object:this
         -29 (-7.86% of base) - System.Net.Mime.SmtpDateTime:TryParseTimeZoneString(System.String,byref):bool:this
          -5 (-7.69% of base) - Microsoft.Diagnostics.Runtime.Utilities.MINIDUMP_MODULE:get_Timestamp():System.DateTime:this
         -12 (-7.36% of base) - <>c__DisplayClass21_0:<Ctor_InvalidSecond_ThrowsArgumentOutOfRangeException>b__0():System.Object:this

236 total methods with Code Size differences (228 improved, 8 regressed), 0 unchanged.
Linux ARM
Running asm diffs of coreclr_tests.pmi.Linux.arm.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 8500
Total bytes of diff: 8368
Total bytes of delta: -132 (-1.55% of base)
    diff is an improvement.


Top method regressions (bytes):
          16 ( 4.08% of base) - JitTest.Test:Main():int
          16 ( 2.19% of base) - JitTest.Test:Main():int
          16 ( 2.19% of base) - JitTest.Test:Main():int

Top method improvements (bytes):
         -24 (-1.84% of base) - Test:TestAllocInNoGCRegion(int,int,bool):bool
         -22 (-3.59% of base) - FinalizerTest:allocateInFinalizerTest():bool:this
         -16 (-17.39% of base) - CC:Static3(short):float
         -12 (-1.39% of base) - Repro:Main():int
         -12 (-1.12% of base) - VectorTest:Main():int
         -10 (-11.11% of base) - SP2b:Foo(int,S):long
         -10 (-1.77% of base) - JitTest.Test:Main():int
         -10 (-10.64% of base) - AA:Static2(System.String[]):TestEnum[]
         -10 (-1.77% of base) - JitTest.Test:Main():int
         -10 (-11.11% of base) - SP2a:Foo(int,S):long
         -10 (-27.78% of base) - LargeObject:get_Size():long:this
         -10 (-16.67% of base) - SP2:Foo(S):long
         -10 (-1.05% of base) - ExchangeAdd.InterlockedAddInt:Main(System.String[]):int
          -8 (-6.67% of base) - SP2c:Foo(int,long,S):long
          -6 (-4.84% of base) - AA:Static1(ushort,int,System.Boolean[,],System.SByte[][,][,,,][][,],byref,byref):System.Char[,,][,,,,]

Top method regressions (percentages):
          16 ( 4.08% of base) - JitTest.Test:Main():int
          16 ( 2.19% of base) - JitTest.Test:Main():int
          16 ( 2.19% of base) - JitTest.Test:Main():int

Top method improvements (percentages):
         -10 (-27.78% of base) - LargeObject:get_Size():long:this
         -16 (-17.39% of base) - CC:Static3(short):float
         -10 (-16.67% of base) - SP2:Foo(S):long
         -10 (-11.11% of base) - SP2b:Foo(int,S):long
         -10 (-11.11% of base) - SP2a:Foo(int,S):long
         -10 (-10.64% of base) - AA:Static2(System.String[]):TestEnum[]
          -8 (-6.67% of base) - SP2c:Foo(int,long,S):long
          -6 (-4.84% of base) - AA:Static1(ushort,int,System.Boolean[,],System.SByte[][,][,,,][][,],byref,byref):System.Char[,,][,,,,]
         -22 (-3.59% of base) - FinalizerTest:allocateInFinalizerTest():bool:this
         -24 (-1.84% of base) - Test:TestAllocInNoGCRegion(int,int,bool):bool
         -10 (-1.77% of base) - JitTest.Test:Main():int
         -10 (-1.77% of base) - JitTest.Test:Main():int
         -12 (-1.39% of base) - Repro:Main():int
         -12 (-1.12% of base) - VectorTest:Main():int
         -10 (-1.05% of base) - ExchangeAdd.InterlockedAddInt:Main(System.String[]):int

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

Running asm diffs of libraries.crossgen.Linux.arm.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 49340
Total bytes of diff: 46970
Total bytes of delta: -2370 (-4.80% of base)
    diff is an improvement.


Top file improvements (bytes):
         -90 : 74659.dasm (-7.92% of base)
         -72 : 79523.dasm (-12.77% of base)
         -58 : 76410.dasm (-15.85% of base)
         -58 : 76605.dasm (-6.13% of base)
         -48 : 79154.dasm (-11.48% of base)
         -48 : 71327.dasm (-4.94% of base)
         -42 : 76579.dasm (-2.53% of base)
         -40 : 76601.dasm (-12.74% of base)
         -40 : 73835.dasm (-4.94% of base)
         -38 : 76408.dasm (-19.00% of base)
         -34 : 73589.dasm (-8.06% of base)
         -34 : 79476.dasm (-6.67% of base)
         -34 : 152799.dasm (-17.00% of base)
         -34 : 73885.dasm (-6.64% of base)
         -34 : 79213.dasm (-7.11% of base)
         -32 : 76444.dasm (-17.02% of base)
         -32 : 131539.dasm (-5.37% of base)
         -32 : 79429.dasm (-4.72% of base)
         -32 : 73584.dasm (-6.43% of base)
         -32 : 131548.dasm (-4.04% of base)

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

Top method improvements (bytes):
         -90 (-7.92% of base) - System.Number:TryNumberToDecimal(byref,byref):bool
         -72 (-12.77% of base) - System.Buffers.Text.Utf8Parser:TryCreateTimeSpan(bool,int,int,int,int,int,byref):bool
         -58 (-15.85% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -58 (-6.13% of base) - System.TimeZoneInfo:ParseTimeOfDay(System.ReadOnlySpan`1[Char]):System.DateTime
         -48 (-11.48% of base) - System.Globalization.TimeSpanParse:TryTimeToTicks(bool,TimeSpanToken,TimeSpanToken,TimeSpanToken,TimeSpanToken,TimeSpanToken,byref):bool
         -48 (-4.94% of base) - DecCalc:VarDecFromR4(float,byref)
         -42 (-2.53% of base) - System.TimeZoneInfo:.ctor(System.Byte[],System.String,bool):this
         -40 (-12.74% of base) - System.TimeZoneInfo:TZif_CalculateTransitionOffsetFromBase(System.TimeSpan,System.TimeSpan):System.TimeSpan
         -40 (-4.94% of base) - System.DateTimeParse:ParseTimeZone(byref,byref):bool
         -38 (-19.00% of base) - System.TimeSpan:.ctor(int,int,int):this
         -34 (-8.06% of base) - System.DateTimeOffset:System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object):this
         -34 (-6.67% of base) - System.Buffers.Text.Utf8Parser:TryCreateDateTimeOffset(System.DateTime,bool,int,int,byref):bool
         -34 (-17.00% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -34 (-6.64% of base) - System.DateTimeParse:ParseTimeZoneOffset(byref,int,byref):bool
         -34 (-7.11% of base) - StringParser:ParseTime(byref,byref):bool:this
         -32 (-17.02% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -32 (-5.37% of base) - Internal.Cryptography.AesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -32 (-4.72% of base) - System.Buffers.Text.Utf8Formatter:TryFormat(System.DateTimeOffset,System.Span`1[Byte],byref,System.Buffers.StandardFormat):bool
         -32 (-6.43% of base) - System.DateTimeOffset:EqualsExact(System.DateTimeOffset):bool:this
         -32 (-4.04% of base) - Internal.Cryptography.DesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this

Top method improvements (percentages):
         -16 (-36.36% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -20 (-35.71% of base) - System.Data.SqlTypes.SqlMoney:.ctor(int):this
         -32 (-30.19% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -16 (-20.00% of base) - System.Xml.BinXmlDateTime:GetKatmaiTimeZoneTicks(System.Byte[],int):long
         -38 (-19.00% of base) - System.TimeSpan:.ctor(int,int,int):this
         -32 (-17.02% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -34 (-17.00% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -16 (-16.67% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingWaitTimeout():System.TimeSpan:this
         -16 (-16.33% of base) - System.DateTime:TimeToTicks(int,int,int):long
         -16 (-16.00% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingKeepAliveTimeout():System.TimeSpan:this
         -16 (-16.00% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_SendTimeout():System.TimeSpan:this
         -58 (-15.85% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -18 (-14.75% of base) - System.Globalization.HebrewCalendar:IsLeapYear(int,int):bool:this
         -32 (-13.22% of base) - System.Globalization.InternalGlobalizationHelper:TimeToTicks(int,int,int):long
         -16 (-12.90% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt32):System.Data.SqlTypes.SqlMoney
         -72 (-12.77% of base) - System.Buffers.Text.Utf8Parser:TryCreateTimeSpan(bool,int,int,int,int,int,byref):bool
         -40 (-12.74% of base) - System.TimeZoneInfo:TZif_CalculateTransitionOffsetFromBase(System.TimeSpan,System.TimeSpan):System.TimeSpan
         -16 (-12.70% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlByte):System.Data.SqlTypes.SqlMoney
         -16 (-12.70% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt16):System.Data.SqlTypes.SqlMoney
         -18 (-12.68% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this

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

Running asm diffs of libraries.crossgen2.Linux.arm.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 66384
Total bytes of diff: 64020
Total bytes of delta: -2364 (-3.56% of base)
    diff is an improvement.


Top method regressions (bytes):
          12 ( 1.00% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this
           2 ( 1.20% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[System.Char],byref):bool

Top method improvements (bytes):
         -90 (-7.59% of base) - System.Number:TryNumberToDecimal(byref,byref):bool
         -72 (-12.77% of base) - System.Buffers.Text.Utf8Parser:TryCreateTimeSpan(bool,int,int,int,int,int,byref):bool
         -58 (-15.34% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -58 (-6.07% of base) - System.TimeZoneInfo:ParseTimeOfDay(System.ReadOnlySpan`1[System.Char]):System.DateTime
         -48 (-11.48% of base) - System.Globalization.TimeSpanParse:TryTimeToTicks(bool,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,System.Globalization.TimeSpanParse+TimeSpanToken,byref):bool
         -48 (-4.89% of base) - DecCalc:VarDecFromR4(float,byref)
         -42 (-2.52% of base) - System.TimeZoneInfo:.ctor(System.Byte[],System.String,bool):this
         -40 (-4.88% of base) - System.DateTimeParse:ParseTimeZone(byref,byref):bool
         -40 (-12.74% of base) - System.TimeZoneInfo:TZif_CalculateTransitionOffsetFromBase(System.TimeSpan,System.TimeSpan):System.TimeSpan
         -38 (-19.00% of base) - System.TimeSpan:.ctor(int,int,int):this
         -34 (-16.19% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -34 (-7.11% of base) - StringParser:ParseTime(byref,byref):bool:this
         -34 (-6.67% of base) - System.Buffers.Text.Utf8Parser:TryCreateDateTimeOffset(System.DateTime,bool,int,int,byref):bool
         -34 (-7.87% of base) - System.DateTimeOffset:System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(System.Object):this
         -34 (-6.64% of base) - System.DateTimeParse:ParseTimeZoneOffset(byref,int,byref):bool
         -32 (-4.41% of base) - Internal.Cryptography.TripleDesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -32 (-17.02% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -32 (-4.48% of base) - Internal.Cryptography.RC2Implementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -32 (-4.91% of base) - Internal.Cryptography.AesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -32 (-3.62% of base) - Internal.Cryptography.DesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this

Top method regressions (percentages):
           2 ( 1.20% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[System.Char],byref):bool
          12 ( 1.00% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (percentages):
         -16 (-36.36% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -20 (-35.71% of base) - System.Data.SqlTypes.SqlMoney:.ctor(int):this
         -32 (-30.19% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -38 (-19.00% of base) - System.TimeSpan:.ctor(int,int,int):this
         -16 (-17.78% of base) - System.Xml.BinXmlDateTime:GetKatmaiTimeZoneTicks(System.Byte[],int):long
         -32 (-17.02% of base) - System.TimeSpan:TimeToTicks(int,int,int):long
         -16 (-16.67% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingWaitTimeout():System.TimeSpan:this
         -16 (-16.33% of base) - System.DateTime:TimeToTicks(int,int,int):long
         -34 (-16.19% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -16 (-16.00% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_SendTimeout():System.TimeSpan:this
         -16 (-16.00% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingKeepAliveTimeout():System.TimeSpan:this
         -58 (-15.34% of base) - System.TimeSpan:.ctor(int,int,int,int,int):this
         -18 (-14.75% of base) - System.Globalization.HebrewCalendar:IsLeapYear(int,int):bool:this
         -16 (-12.90% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt32):System.Data.SqlTypes.SqlMoney
         -72 (-12.77% of base) - System.Buffers.Text.Utf8Parser:TryCreateTimeSpan(bool,int,int,int,int,int,byref):bool
         -40 (-12.74% of base) - System.TimeZoneInfo:TZif_CalculateTransitionOffsetFromBase(System.TimeSpan,System.TimeSpan):System.TimeSpan
         -16 (-12.70% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt16):System.Data.SqlTypes.SqlMoney
         -16 (-12.70% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlByte):System.Data.SqlTypes.SqlMoney
         -32 (-12.60% of base) - System.Globalization.InternalGlobalizationHelper:TimeToTicks(int,int,int):long
         -18 (-11.84% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this

110 total methods with Code Size differences (108 improved, 2 regressed), 0 unchanged.

Running asm diffs of libraries.pmi.Linux.arm.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 76032
Total bytes of diff: 74632
Total bytes of delta: -1400 (-1.84% of base)
    diff is an improvement.


Top method regressions (bytes):
          14 ( 1.35% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (bytes):
         -58 (-1.53% of base) - System.Formats.Asn1.AsnDecoder:ParseGeneralizedTime(int,System.ReadOnlySpan`1[Byte]):System.DateTimeOffset
         -56 (-4.66% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeIso(Newtonsoft.Json.Utilities.StringReference,int,byref):bool
         -56 (-4.70% of base) - Newtonsoft.Json.Bson.Utilities.DateTimeUtils:TryParseDateTimeIso(System.String,int,byref):bool
         -50 (-3.06% of base) - System.Xml.Schema.XsdDateTime:op_Implicit(System.Xml.Schema.XsdDateTime):System.DateTimeOffset
         -50 (-8.45% of base) - System.Xml.Schema.XsdDateTime:ToZulu():System.DateTime:this
         -46 (-6.85% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(Newtonsoft.Json.Utilities.StringReference,byref):bool
         -46 (-0.78% of base) - System.Data.FunctionNode:EvalFunction(int,System.Object[],System.Data.DataRow,int):System.Object:this
         -46 (-6.97% of base) - Newtonsoft.Json.Bson.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(System.String,byref):bool
         -44 (-2.15% of base) - System.Xml.Schema.XsdDateTime:op_Implicit(System.Xml.Schema.XsdDateTime):System.DateTime
         -30 (-4.07% of base) - System.ServiceModel.Syndication.Rss20FeedFormatter:AsString(System.DateTimeOffset):System.String:this
         -30 (-1.29% of base) - System.ComponentModel.DateTimeOffsetConverter:ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type):System.Object:this
         -30 (-4.63% of base) - System.ServiceModel.Syndication.Atom10FeedFormatter:AsString(System.DateTimeOffset):System.String:this
         -26 (-1.67% of base) - System.Xml.XmlConverter:TryParseDateTime(System.Byte[],int,int,byref):bool
         -24 (-10.08% of base) - System.Data.ProviderBase.DbBuffer:ReadTime(int):System.TimeSpan:this
         -22 (-5.82% of base) - System.Net.Mime.SmtpDateTime:TryParseTimeZoneString(System.String,byref):bool:this
         -22 (-4.20% of base) - Internal.Cryptography.AesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -22 (-2.79% of base) - Internal.Cryptography.DesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -20 (-3.77% of base) - System.Runtime.Serialization.DateTimeOffsetAdapter:GetDateTimeOffset(System.Runtime.Serialization.DateTimeOffsetAdapter):System.DateTimeOffset
         -20 (-3.79% of base) - Internal.Cryptography.RC2Implementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this
         -20 (-3.37% of base) - Internal.Cryptography.TripleDesImplementation:CreateTransform(System.Byte[],System.Byte[],bool):System.Security.Cryptography.ICryptoTransform:this

Top method regressions (percentages):
          14 ( 1.35% of base) - Microsoft.CodeAnalysis.CSharp.Symbols.SourceFixedFieldSymbol:get_FixedSize():int:this

Top method improvements (percentages):
         -10 (-26.32% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -10 (-21.74% of base) - System.Data.SqlTypes.SqlMoney:.ctor(int):this
         -20 (-21.28% of base) - System.Security.Cryptography.Pkcs.Asn1.Rfc3161Accuracy:get_TotalMicros():long:this
         -10 (-20.83% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingWaitTimeout():System.TimeSpan:this
         -10 (-19.23% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_PingKeepAliveTimeout():System.TimeSpan:this
         -10 (-19.23% of base) - System.DirectoryServices.Protocols.LdapSessionOptions:get_SendTimeout():System.TimeSpan:this
         -10 (-12.50% of base) - System.Xml.BinXmlDateTime:GetKatmaiTimeZoneTicks(System.Byte[],int):long
         -24 (-10.08% of base) - System.Data.ProviderBase.DbBuffer:ReadTime(int):System.TimeSpan:this
         -12 (-8.96% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -50 (-8.45% of base) - System.Xml.Schema.XsdDateTime:ToZulu():System.DateTime:this
         -10 (-7.81% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt32):System.Data.SqlTypes.SqlMoney
         -10 (-7.69% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlByte):System.Data.SqlTypes.SqlMoney
         -10 (-7.69% of base) - System.Data.SqlTypes.SqlMoney:op_Implicit(System.Data.SqlTypes.SqlInt16):System.Data.SqlTypes.SqlMoney
         -12 (-7.32% of base) - Microsoft.VisualBasic.DateAndTime:TimeSerial(int,int,int):System.DateTime
         -46 (-6.97% of base) - Newtonsoft.Json.Bson.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(System.String,byref):bool
         -46 (-6.85% of base) - Newtonsoft.Json.Utilities.DateTimeUtils:TryParseDateTimeOffsetIso(Newtonsoft.Json.Utilities.StringReference,byref):bool
         -10 (-6.41% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -12 (-6.19% of base) - PEFile.PEHeader:TimeDateStampToDate(int):System.DateTime
         -12 (-5.83% of base) - System.Numerics.BigInteger:GetBitLength():long:this
         -22 (-5.82% of base) - System.Net.Mime.SmtpDateTime:TryParseTimeZoneString(System.String,byref):bool:this

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

Running asm diffs of libraries_tests.pmi.Linux.arm.checked.mch

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 575780
Total bytes of diff: 567378
Total bytes of delta: -8402 (-1.46% of base)
    diff is an improvement.


Top method regressions (bytes):
           2 ( 0.37% of base) - Microsoft.Diagnostics.Runtime.GCDesc:WalkObject(long,long,System.Func`2[UInt64,UInt64],System.Action`2[UInt64,Int32]):this

Top method improvements (bytes):
        -320 (-4.58% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_PerthRules()
        -300 (-4.60% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_Invalid()
        -292 (-3.92% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_LocalAmbiguousOffsets()
        -260 (-3.97% of base) - System.Tests.TimeZoneInfoTests:ConverTime_DateTime_VariousSystemTimeZonesTest()
        -250 (-3.38% of base) - System.Xml.Tests.ToTypeTests:ToType57():int:this
        -220 (-2.05% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToSystem()
        -210 (-2.87% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_MiscUtc()
        -150 (-2.95% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_Tonga()
        -140 (-2.10% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToUtc()
        -136 (-4.81% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_VariousDateTimeKinds()
        -130 (-2.21% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToLocal()
        -120 (-3.05% of base) - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_UtcToLocal()
        -104 (-3.08% of base) - System.Text.Json.Serialization.Tests.TestClassWithStringToPrimitiveDictionary:Initialize():this
        -102 (-4.01% of base) - System.Tests.DateTimeOffsetTests:ParseExact_ToStringThenParseExactRoundtrip_Success(System.String)
        -100 (-0.66% of base) - System.Tests.TimeZoneInfoTests:IsDaylightSavingTime()
        -100 (-2.21% of base) - System.Tests.TimeZoneInfoTests:IsDaylightSavingTime_CatamarcaMultiYearDaylightSavings()
        -100 (-4.63% of base) - System.Tests.TimeZoneInfoTests:GetAmbiguousTimeOffsets_Nairobi_Invalid()
         -96 (-3.18% of base) - <GetEra_TestData>d__0:MoveNext():bool:this
         -96 (-3.18% of base) - <GetMonth_TestData>d__0:MoveNext():bool:this
         -94 (-2.92% of base) - <GetYear_TestData>d__0:MoveNext():bool:this

Top method regressions (percentages):
           2 ( 0.37% of base) - Microsoft.Diagnostics.Runtime.GCDesc:WalkObject(long,long,System.Func`2[UInt64,UInt64],System.Action`2[UInt64,Int32]):this

Top method improvements (percentages):
         -10 (-26.32% of base) - System.Data.Common.ADP:TimerFromSeconds(int):long
         -12 (-26.09% of base) - System.Data.SqlClient.TdsParserStateObject:SetTimeoutSeconds(int):this
         -12 (-26.09% of base) - System.Data.SqlClient.TdsParserStateObject:SetTimeoutSeconds(int):this
         -14 (-21.21% of base) - ExtendedArray`1[__Canon][System.__Canon]:get_Count():long:this
         -14 (-21.21% of base) - ExtendedArray`1[Byte][System.Byte]:get_Count():long:this
         -16 (-11.59% of base) - System.Data.SqlClient.SqlBulkCopy:WriteMetaData(System.Data.SqlClient.BulkCopySimpleResultSet):this
         -16 (-11.59% of base) - System.Data.SqlClient.SqlBulkCopy:WriteMetaData(System.Data.SqlClient.BulkCopySimpleResultSet):this
         -24 (-8.82% of base) - genTimeZone@885-2:Invoke(int):FsCheck.Gen`1[TimeSpan]:this
          -6 (-8.57% of base) - Microsoft.Diagnostics.Runtime.Utilities.MINIDUMP_MODULE:get_Timestamp():System.DateTime:this
         -10 (-7.14% of base) - System.Data.SqlClient.SqlSequentialStream:.ctor(System.Data.SqlClient.SqlDataReader,int):this
         -10 (-7.14% of base) - System.Data.SqlClient.SqlSequentialStream:.ctor(System.Data.SqlClient.SqlDataReader,int):this
         -12 (-6.90% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
         -12 (-6.90% of base) - System.Data.ProviderBase.TimeoutTimer:SetTimeoutSeconds(int):this
          -8 (-6.56% of base) - NuGet.Packaging.Signing.Accuracy:GetTotalMicroseconds():System.Nullable`1[Int64]:this
         -10 (-6.41% of base) - System.Net.Http.Headers.AltSvcHeaderParser:TryReadQuotedInt32Value(System.ReadOnlySpan`1[Char],byref):bool
         -22 (-5.70% of base) - System.Net.Mime.SmtpDateTime:TryParseTimeZoneString(System.String,byref):bool:this
         -10 (-5.21% of base) - System.Data.SqlClient.TdsParserStaticMethods:GetRemainingTimeout(int,long):int
         -10 (-5.21% of base) - System.Data.SqlClient.TdsParserStaticMethods:GetRemainingTimeout(int,long):int
         -10 (-5.00% of base) - <>c:<Ctor_Int_Int_Int_Invalid>b__6_0():System.Object:this
         -10 (-5.00% of base) - <>c:<Ctor_Int_Int_Int_Invalid>b__6_1():System.Object:this

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

Most regressions are caused by the fact that the new code doesn't try to look for CAST(CONST), and that is impactful for cases when we emit debuggable code - it now goes through the helper. Because there are so few regressions, and they are for debuggable code only, I decided not to complicate the code by fixing it. The <ReadHeadersAsync>d__43:MoveNext() regression is caused by different register allocation, even as the helper call was turned into imul. One of the regressions on ARM is caused by a lack of CSE.

@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 Jun 2, 2021
@SingleAccretion SingleAccretion force-pushed the Fix-64-Bit-BigMul-On-32-Bit branch 3 times, most recently from 7ef2138 to 1e7a2d8 Compare June 2, 2021 15:45
To understand the new format for long muls.
Previously, morph was looking for the exact pattern of
MUL(CAST(long <- int), CAST(long <- int)) when assessing
candidacy of GT_MUL for being marked with "GTF_MUL_64RSLT" and
emitted as "long mul".

This worked fine, until the importer was changed to fold
all casts with constant operands. This broke the pattern
matching and thus all MULs in the form of (long)value * 10
started being emitted as helper calls.

This change updates morph to understand the new folded casts
and in general updates the "format" of long mul from
"CAST * CAST" to "CAST * (CAST | CONST)".

In the process, new helper functions have been introduced, to
avoid bloating fgMorphSmpOp with the new sizeable logic.

Recognition of overflowing cases has been upgraded, and a correctness
bug, where "checked((long)uint.MaxValue * (long)uint.MaxValue)"
was wrongly treated as non-overflowing, fixed.

Additionally, the logic to emit intermediate NOPs has been
changed to instead always skip morphing the casts themselves,
even when remorphing.
@SingleAccretion
Copy link
Contributor Author

Marking as ready for review, the failure is unrelated (no tests ran and python crashed at the end).

cc @sandreenko - more morph changes...

@SingleAccretion SingleAccretion marked this pull request as ready for review June 2, 2021 21:39
@sandreenko
Copy link
Contributor

PTAL @dotnet/jit-contrib , I probably won't have time to review it this week.

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.

Changes LGTM. Thanks!

Would it make sense to check the script in alongside the test?

As a follow up perhaps we can scrub uses of GTF_MUL_64RST from the other places in the jit?

@SingleAccretion
Copy link
Contributor Author

As a follow up perhaps we can scrub uses of GTF_MUL_64RST from the other places in the jit?

Perhaps. I am in the process of experimenting with moving most of the "morph to helpers" logic to lowering, so that we don't have to play tricks like completely blocking long mul trees from assertion propagation for correctness reasons. If that fails (fairly likely given it is not so trivial to add new calls that late), I will of course update all the places that use the flag today to use the helpers.

Speaking of flags, I will have to rebase so as not to fail the build now that we have to use GTF_EMPTY instead of 0 for them.

Would it make sense to check the script in alongside the test?

Sounds good to me, and there's precedent in the ldind + cast test. I will convert the script to be csx-friendly, clean it up, and commit it in.

The test itself has been regenerated using it and
there were no diffs, as expected.
Copy link
Contributor

@sandreenko sandreenko left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@sandreenko sandreenko merged commit 17828d1 into dotnet:main Jun 25, 2021
@SingleAccretion SingleAccretion deleted the Fix-64-Bit-BigMul-On-32-Bit branch June 25, 2021 09:32
@ghost ghost locked as resolved and limited conversation to collaborators Jul 25, 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.

3 participants