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

JIT: Improve VN for (EQ/NE (RELOP ...), 0/1) #60943

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

AndyAyersMS
Copy link
Member

Try and re-express these VNs in terms of the RELOP or its complement.

Try and re-express these VNs in terms of the RELOP or its complement.
@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 Oct 27, 2021
@ghost
Copy link

ghost commented Oct 27, 2021

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

Issue Details

Try and re-express these VNs in terms of the RELOP or its complement.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

cc @dotnet/jit-contrib

Next installment in the ongoing saga of removing branch redundancy. Surprising number and amount of diffs. Will post some diff snippets shortly.

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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 11893704 (overridden on cmd)
Total bytes of diff: 11893092 (overridden on cmd)
Total bytes of delta: -612 (-0.01 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
        -144 : 32206.dasm (-3.49% of base)
        -131 : 6141.dasm (-3.14% of base)
        -131 : 11977.dasm (-3.14% of base)
         -77 : 29286.dasm (-3.51% of base)
         -54 : 6120.dasm (-2.57% of base)
         -49 : 6327.dasm (-2.35% of base)
         -26 : 24081.dasm (-1.07% of base)

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

Top method improvements (bytes):
        -144 (-3.49% of base) : 32206.dasm - HttpParser`1:ParseMultiSpanHeader(Http1ParsingHandler,byref):int:this
        -131 (-3.14% of base) : 11977.dasm - HttpParser`1:ParseMultiSpanHeader(Http1ParsingHandler,byref):int:this
        -131 (-3.14% of base) : 6141.dasm - HttpParser`1:ParseMultiSpanHeader(ParsingAdapter,byref):int:this
         -77 (-3.51% of base) : 29286.dasm - <ReadAsyncInternal>d__27:MoveNext():this
         -54 (-2.57% of base) : 6120.dasm - BenchmarkApplication:HandleRequests(byref,bool):bool:this
         -49 (-2.35% of base) : 6327.dasm - BenchmarkApplication:HandleRequests(byref,bool):bool:this
         -26 (-1.07% of base) : 24081.dasm - <ReadAsyncInternal>d__27:MoveNext():this

Top method improvements (percentages):
         -77 (-3.51% of base) : 29286.dasm - <ReadAsyncInternal>d__27:MoveNext():this
        -144 (-3.49% of base) : 32206.dasm - HttpParser`1:ParseMultiSpanHeader(Http1ParsingHandler,byref):int:this
        -131 (-3.14% of base) : 11977.dasm - HttpParser`1:ParseMultiSpanHeader(Http1ParsingHandler,byref):int:this
        -131 (-3.14% of base) : 6141.dasm - HttpParser`1:ParseMultiSpanHeader(ParsingAdapter,byref):int:this
         -54 (-2.57% of base) : 6120.dasm - BenchmarkApplication:HandleRequests(byref,bool):bool:this
         -49 (-2.35% of base) : 6327.dasm - BenchmarkApplication:HandleRequests(byref,bool):bool:this
         -26 (-1.07% of base) : 24081.dasm - <ReadAsyncInternal>d__27:MoveNext():this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 7236062 (overridden on cmd)
Total bytes of diff: 7212861 (overridden on cmd)
Total bytes of delta: -23201 (-0.32 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
        -323 : 9805.dasm (-10.10% of base)
        -295 : 7204.dasm (-23.93% of base)
        -277 : 3473.dasm (-13.86% of base)
        -275 : 6365.dasm (-3.69% of base)
        -254 : 17164.dasm (-2.66% of base)
        -239 : 10251.dasm (-15.74% of base)
        -238 : 3472.dasm (-20.59% of base)
        -214 : 6078.dasm (-24.83% of base)
        -205 : 17222.dasm (-4.67% of base)
        -200 : 18376.dasm (-5.70% of base)
        -192 : 16154.dasm (-17.84% of base)
        -186 : 13304.dasm (-8.34% of base)
        -185 : 7207.dasm (-8.75% of base)
        -181 : 18065.dasm (-4.44% of base)
        -175 : 1659.dasm (-23.52% of base)
        -173 : 22604.dasm (-11.73% of base)
        -172 : 5803.dasm (-11.11% of base)
        -171 : 12651.dasm (-24.36% of base)
        -170 : 23460.dasm (-11.17% of base)
        -168 : 8106.dasm (-11.80% of base)

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

Top method improvements (bytes):
        -323 (-10.10% of base) : 9805.dasm - System.Reflection.Metadata.MetadataReader:InitializeStreamReaders(byref,System.Reflection.Metadata.Ecma335.StreamHeader[],byref,byref,byref):this
        -295 (-23.93% of base) : 7204.dasm - System.Xml.XmlWellFormedWriter:AddAttribute(System.String,System.String,System.String):this
        -277 (-13.86% of base) : 3473.dasm - NamespaceManager:AddNamespace(System.String,System.String,System.Xml.XmlDictionaryString):this
        -275 (-3.69% of base) : 6365.dasm - ProtoBuf.Meta.MetaType:ApplyDefaultBehaviourImpl(int):this
        -254 (-2.66% of base) : 17164.dasm - Microsoft.CodeAnalysis.CSharp.SyntaxFacts:GetKeywordKind(System.String):ushort
        -239 (-15.74% of base) : 10251.dasm - System.Xml.Linq.XAttribute:ValidateAttribute(System.Xml.Linq.XName,System.String)
        -238 (-20.59% of base) : 3472.dasm - NamespaceManager:LookupPrefix(System.String):System.String:this
        -214 (-24.83% of base) : 6078.dasm - System.Text.RegularExpressions.RegexCharClass:<MayOverlap>g__KnownDistinctSets|72_0(System.String,System.String):bool
        -205 (-4.67% of base) : 17222.dasm - Microsoft.CodeAnalysis.CSharp.SyntaxFacts:GetContextualKeywordKind(System.String):ushort
        -200 (-5.70% of base) : 18376.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol:ComputeInterfaceImplementations(Microsoft.CodeAnalysis.DiagnosticBag,System.Threading.CancellationToken):System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.Symbols.SynthesizedExplicitImplementationForwardingMethod, Microsoft.CodeAnalysis.CSharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
        -192 (-17.84% of base) : 16154.dasm - System.Xml.Serialization.AccessorMapping:ElementsMatch(System.Xml.Serialization.ElementAccessor[],System.Xml.Serialization.ElementAccessor[]):bool
        -186 (-8.34% of base) : 13304.dasm - DynamicClass:ReadLoginViewModelFromXml(System.Runtime.Serialization.XmlReaderDelegator,System.Runtime.Serialization.XmlObjectSerializerReadContext,System.Xml.XmlDictionaryString[],System.Xml.XmlDictionaryString[]):System.Object
        -185 (-8.75% of base) : 7207.dasm - System.Xml.XmlWellFormedWriter:WriteEndAttribute():this
        -181 (-4.44% of base) : 18065.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEMethodSymbol:ComputeMethodKind():int:this
        -175 (-23.52% of base) : 1659.dasm - Newtonsoft.Json.Serialization.DefaultContractResolver:IsConcurrentOrObservableCollection(System.Type):bool
        -173 (-11.73% of base) : 22604.dasm - System.Text.Json.Utf8JsonReader:TryGetDateTimeCore(byref):bool:this
        -172 (-11.11% of base) : 5803.dasm - System.Text.Json.Reflection.ReflectionExtensions:IsImmutableEnumerableType(System.Type,bool):bool
        -171 (-24.36% of base) : 12651.dasm - System.Xml.XmlConvert:ToBoolean(System.String):bool
        -170 (-11.17% of base) : 23460.dasm - System.Text.Json.Utf8JsonReader:TryGetGuidCore(byref):bool:this
        -168 (-11.80% of base) : 8106.dasm - System.Runtime.Serialization.Json.XmlJsonWriter:WriteEndAttribute():this

Top method improvements (percentages):
         -67 (-36.02% of base) : 228.dasm - System.String:Equals(System.String,System.String):bool
        -107 (-30.66% of base) : 3199.dasm - System.String:TrimWhiteSpaceHelper(int):System.String:this
         -85 (-29.51% of base) : 6400.dasm - ProtoBuf.Meta.MetaType:GetAttribute(ProtoBuf.Meta.AttributeMap[],System.String):ProtoBuf.Meta.AttributeMap
         -59 (-29.50% of base) : 2696.dasm - System.Array:Sort(System.UInt64[],int,int,System.Collections.Generic.IComparer`1[UInt64])
         -91 (-29.07% of base) : 7202.dasm - System.Xml.XmlWellFormedWriter:LookupNamespace(System.String):System.String:this
         -71 (-28.98% of base) : 5330.dasm - System.Globalization.DateTimeFormatInfoScanner:ArrayElementsHaveSpace(System.String[]):bool
         -46 (-28.40% of base) : 4538.dasm - <>c:<.cctor>b__6_0(System.Diagnostics.ActivitySource):bool:this
         -91 (-28.17% of base) : 7199.dasm - System.Xml.XmlWellFormedWriter:LookupNamespaceIndex(System.String):int:this
         -81 (-27.36% of base) : 4600.dasm - System.Diagnostics.ActivityTagsCollection:FindIndex(System.String):int:this
         -46 (-26.90% of base) : 3061.dasm - System.Xml.Serialization.CodeGenerator:IsNullableGenericType(System.Type):bool
        -142 (-26.89% of base) : 5327.dasm - System.Globalization.DateTimeFormatInfoScanner:EqualStringArrays(System.String[],System.String[]):bool
        -128 (-26.56% of base) : 59.dasm - System.Text.ASCIIUtility:NarrowUtf16ToAscii(long,long,long):long
         -46 (-26.44% of base) : 10335.dasm - <>c:<.cctor>b__6_0(System.Reflection.MethodInfo):bool:this
         -50 (-26.32% of base) : 1106.dasm - System.String:IsNullOrWhiteSpace(System.String):bool
        -110 (-25.94% of base) : 2872.dasm - System.Boolean:TrimWhiteSpaceAndNull(System.ReadOnlySpan`1[Char]):System.ReadOnlySpan`1[Char]
         -90 (-25.94% of base) : 13280.dasm - System.Runtime.Serialization.XmlReaderDelegator:IndexOfLocalName(System.Xml.XmlDictionaryString[],System.Xml.XmlDictionaryString):int:this
         -50 (-25.91% of base) : 6518.dasm - <>c:<.cctor>b__1_0(System.Reflection.MethodInfo):bool:this
        -102 (-25.69% of base) : 430.dasm - System.MemoryExtensions:Trim(System.ReadOnlySpan`1[Char]):System.ReadOnlySpan`1[Char]
         -90 (-25.14% of base) : 1658.dasm - Newtonsoft.Json.Serialization.DefaultContractResolver:ShouldSkipSerializing(System.Type):bool
         -54 (-24.88% of base) : 7934.dasm - <>c:<.cctor>b__45_0(System.Reflection.MethodInfo):bool:this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 127268821 (overridden on cmd)
Total bytes of diff: 127235729 (overridden on cmd)
Total bytes of delta: -33092 (-0.03 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
        -731 : 228857.dasm (-15.22% of base)
        -447 : 237998.dasm (-8.29% of base)
        -445 : 244899.dasm (-19.12% of base)
        -419 : 198820.dasm (-7.16% of base)
        -267 : 249941.dasm (-14.24% of base)
        -265 : 246234.dasm (-25.93% of base)
        -265 : 246235.dasm (-25.93% of base)
        -260 : 251804.dasm (-21.96% of base)
        -255 : 85296.dasm (-22.53% of base)
        -255 : 85302.dasm (-22.53% of base)
        -253 : 238546.dasm (-15.85% of base)
        -249 : 238547.dasm (-16.05% of base)
        -234 : 238065.dasm (-3.84% of base)
        -234 : 238105.dasm (-4.98% of base)
        -230 : 238098.dasm (-5.67% of base)
        -228 : 233455.dasm (-13.50% of base)
        -200 : 233462.dasm (-14.96% of base)
        -195 : 246561.dasm (-14.52% of base)
        -194 : 240806.dasm (-4.18% of base)
        -191 : 246409.dasm (-21.18% of base)

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

Top method improvements (bytes):
        -731 (-15.22% of base) : 228857.dasm - BenchmarkConsoleApplication.BenchmarkSystem:ProcessCommandLine(System.String[]):this
        -447 (-8.29% of base) : 237998.dasm - Test:bar(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String):int
        -445 (-19.12% of base) : 244899.dasm - TestClass:LoadTypeInternal(System.String):System.Type
        -419 (-7.16% of base) : 198820.dasm - TailcallVerify.Program:Run(System.String):int
        -267 (-14.24% of base) : 249941.dasm - HelloWorld:Main(System.String[]):int
        -265 (-25.93% of base) : 246234.dasm - ThreadSafe:ThreadWorkerA(System.Object):this
        -265 (-25.93% of base) : 246235.dasm - ThreadSafe:ThreadWorkerB(System.Object):this
        -260 (-21.96% of base) : 251804.dasm - MS.VT:RunTests():bool:this
        -255 (-22.53% of base) : 85296.dasm - MS.VT:RunTests():bool:this
        -255 (-22.53% of base) : 85302.dasm - MS.VT:RunTests():bool:this
        -253 (-15.85% of base) : 238546.dasm - Test2:TestSameObjRef():bool
        -249 (-16.05% of base) : 238547.dasm - Test2:TestDiffObjRef():bool
        -234 (-3.84% of base) : 238065.dasm - Node:VerifyValid():this
        -234 (-4.98% of base) : 238105.dasm - Node:VerifyValid():this
        -230 (-5.67% of base) : 238098.dasm - Node:VerifyValid():this
        -228 (-13.50% of base) : 233455.dasm - GC_Microbenchmarks.GCMicroBench:ParseArgs(System.String[]):bool:this
        -200 (-14.96% of base) : 233462.dasm - WeakReferenceTest:Main(System.String[])
        -195 (-14.52% of base) : 246561.dasm - <>c__DisplayClass5_0:<.cctor>b__2(Microsoft.Diagnostics.Tracing.TraceEvent):this
        -194 (-4.18% of base) : 240806.dasm - GitHub_16377:Test()
        -191 (-21.18% of base) : 246409.dasm - <>c__DisplayClass2_0:<RunTest>b__0(Microsoft.Diagnostics.Tracing.TraceEvent):this

Top method improvements (percentages):
          -8 (-47.06% of base) : 238201.dasm - InlineBool.Program:Id42(bool):bool
         -90 (-28.66% of base) : 210194.dasm - Internal.TypeSystem.Ecma.CachingMetadataStringDecoder:Find(int,System.String):System.String:this
         -94 (-27.41% of base) : 210491.dasm - ILVerify.VerificationResult:TryGetArgumentValue(System.String,byref):bool:this
        -128 (-26.56% of base) : 5.dasm - System.Text.ASCIIUtility:NarrowUtf16ToAscii(long,long,long):long
        -177 (-26.26% of base) : 246236.dasm - ThreadSafe:ThreadChecker():this
         -90 (-26.01% of base) : 210490.dasm - ILVerify.VerificationResult:TryGetArgumentValue(System.String,byref):bool:this
        -265 (-25.93% of base) : 246234.dasm - ThreadSafe:ThreadWorkerA(System.Object):this
        -265 (-25.93% of base) : 246235.dasm - ThreadSafe:ThreadWorkerB(System.Object):this
        -102 (-25.69% of base) : 86260.dasm - Program:TrimSourceCopied(System.ReadOnlySpan`1[Char]):System.ReadOnlySpan`1[Char]
         -48 (-24.74% of base) : 199131.dasm - BinderTracingTests.BinderEventListener:OnEventSourceCreated(System.Diagnostics.Tracing.EventSource):this
         -48 (-24.74% of base) : 199039.dasm - BinderTracingTests.BinderEventListener:OnEventSourceCreated(System.Diagnostics.Tracing.EventSource):this
         -43 (-24.57% of base) : 209345.dasm - Internal.TypeSystem.MethodDesc:get_IsConstructor():bool:this
         -43 (-24.16% of base) : 246473.dasm - <>c:<DefineIgnoresAccessChecksToAttribute>b__2_1(System.Reflection.PropertyInfo):bool:this
         -95 (-23.75% of base) : 233772.dasm - Handlers:OnResolvingUnmanagedDll(System.Reflection.Assembly,System.String):long:this
         -38 (-23.60% of base) : 251372.dasm - <>c__DisplayClass5_0:<.cctor>b__2(Microsoft.Diagnostics.Tracing.TraceEvent):this
        -111 (-23.27% of base) : 233692.dasm - <>c:<SetupUnicodeTest>b__25_0(System.IO.FileInfo):bool:this
         -47 (-23.27% of base) : 192638.dasm - <>c:<.cctor>b__24_0(System.Reflection.MethodInfo):bool:this
         -47 (-23.27% of base) : 84068.dasm - Test:f1(System.String):System.Object
         -47 (-23.27% of base) : 84066.dasm - Test:f2(System.String):System.Object:this
         -82 (-22.91% of base) : 86741.dasm - HelloWorld:Main():int

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 34150239 (overridden on cmd)
Total bytes of diff: 34144421 (overridden on cmd)
Total bytes of delta: -5818 (-0.02 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
        -284 : 49713.dasm (-20.96% of base)
        -253 : 49936.dasm (-24.00% of base)
        -220 : 49712.dasm (-17.53% of base)
        -218 : 49935.dasm (-22.13% of base)
        -157 : 57170.dasm (-14.91% of base)
        -114 : 46843.dasm (-13.80% of base)
        -104 : 59039.dasm (-12.61% of base)
         -91 : 49715.dasm (-13.34% of base)
         -88 : 54392.dasm (-19.86% of base)
         -88 : 54390.dasm (-20.47% of base)
         -88 : 54402.dasm (-18.97% of base)
         -86 : 54397.dasm (-19.28% of base)
         -86 : 54398.dasm (-19.28% of base)
         -86 : 49941.dasm (-13.31% of base)
         -86 : 49942.dasm (-13.31% of base)
         -82 : 49939.dasm (-16.33% of base)
         -82 : 49940.dasm (-16.33% of base)
         -80 : 50615.dasm (-14.01% of base)
         -77 : 46841.dasm (-9.70% of base)
         -76 : 54399.dasm (-18.18% of base)

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

Top method improvements (bytes):
        -284 (-20.96% of base) : 49713.dasm - System.Globalization.OrdinalCasing:IndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
        -253 (-24.00% of base) : 49936.dasm - System.Globalization.InvariantModeCasing:IndexOfIgnoreCase(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
        -220 (-17.53% of base) : 49712.dasm - System.Globalization.OrdinalCasing:LastIndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
        -218 (-22.13% of base) : 49935.dasm - System.Globalization.InvariantModeCasing:LastIndexOfIgnoreCase(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
        -157 (-14.91% of base) : 57170.dasm - System.String:Compare(System.String,int,System.String,int,int,int):int
        -114 (-13.80% of base) : 46843.dasm - System.Text.ASCIIUtility:GetIndexOfFirstNonAsciiByte_Intrinsified(long,long):long
        -104 (-12.61% of base) : 59039.dasm - System.Globalization.TextInfo:ChangeCaseCommon(byref,byref,int):this
         -91 (-13.34% of base) : 49715.dasm - System.Globalization.OrdinalCasing:ToUpperOrdinal(System.ReadOnlySpan`1[System.Char],System.Span`1[System.Char])
         -88 (-19.86% of base) : 54392.dasm - System.MemoryExtensions:EndsWith(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):bool
         -88 (-18.97% of base) : 54402.dasm - System.MemoryExtensions:Equals(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):bool
         -88 (-20.47% of base) : 54390.dasm - System.MemoryExtensions:StartsWith(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):bool
         -86 (-13.31% of base) : 49942.dasm - System.Globalization.InvariantModeCasing:ToLower(System.String):System.String
         -86 (-13.31% of base) : 49941.dasm - System.Globalization.InvariantModeCasing:ToUpper(System.String):System.String
         -86 (-19.28% of base) : 54398.dasm - System.MemoryExtensions:IndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):int
         -86 (-19.28% of base) : 54397.dasm - System.MemoryExtensions:LastIndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):int
         -82 (-16.33% of base) : 49939.dasm - System.Globalization.InvariantModeCasing:ToLower(System.ReadOnlySpan`1[System.Char],System.Span`1[System.Char])
         -82 (-16.33% of base) : 49940.dasm - System.Globalization.InvariantModeCasing:ToUpper(System.ReadOnlySpan`1[System.Char],System.Span`1[System.Char])
         -80 (-14.01% of base) : 50615.dasm - System.Globalization.CompareInfo:InvariantCreateSortKeyOrdinalIgnoreCase(System.ReadOnlySpan`1[System.Char],System.Span`1[System.Byte])
         -77 (-9.70% of base) : 46841.dasm - System.Text.ASCIIUtility:GetIndexOfFirstNonAsciiChar_Sse2(long,long):long
         -76 (-18.18% of base) : 54399.dasm - System.MemoryExtensions:CompareTo(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):int

Top method improvements (percentages):
         -44 (-62.86% of base) : 55872.dasm - System.DateOnly:FromDayNumber(int):System.DateOnly
         -43 (-61.43% of base) : 55866.dasm - System.DateOnly:AddDays(int):System.DateOnly:this
         -41 (-33.06% of base) : 56853.dasm - System.Type:MakeGenericMethodParameter(int):System.Type
         -54 (-30.17% of base) : 57157.dasm - System.String:Equals(System.String,System.String):bool
         -62 (-25.20% of base) : 48718.dasm - System.Threading.ThreadPool:QueueUserWorkItem(System.Threading.WaitCallback,System.Object):bool
         -50 (-24.51% of base) : 58268.dasm - System.Array:Sort(System.__Canon[],int,int,System.Collections.Generic.IComparer`1[System.__Canon])
        -253 (-24.00% of base) : 49936.dasm - System.Globalization.InvariantModeCasing:IndexOfIgnoreCase(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
         -43 (-22.99% of base) : 59634.dasm - System.Array:Sort(System.UInt64[],int,int,System.Collections.Generic.IComparer`1[System.UInt64])
         -62 (-22.38% of base) : 48717.dasm - System.Threading.ThreadPool:QueueUserWorkItem(System.Action`1[System.__Canon],System.__Canon,bool):bool
         -31 (-22.30% of base) : 48715.dasm - System.Threading.ThreadPool:UnsafeQueueUserWorkItem(System.Threading.WaitCallback,System.Object):bool
        -218 (-22.13% of base) : 49935.dasm - System.Globalization.InvariantModeCasing:LastIndexOfIgnoreCase(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
        -284 (-20.96% of base) : 49713.dasm - System.Globalization.OrdinalCasing:IndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char]):int
         -88 (-20.47% of base) : 54390.dasm - System.MemoryExtensions:StartsWith(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):bool
         -88 (-19.86% of base) : 54392.dasm - System.MemoryExtensions:EndsWith(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):bool
         -86 (-19.28% of base) : 54398.dasm - System.MemoryExtensions:IndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):int
         -86 (-19.28% of base) : 54397.dasm - System.MemoryExtensions:LastIndexOf(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):int
         -62 (-19.20% of base) : 58893.dasm - System.Threading.ThreadPool:QueueUserWorkItem(System.Action`1[System.ValueTuple`2[System.__Canon, System.__Canon]],System.ValueTuple`2[System.__Canon, System.__Canon],bool):bool
         -37 (-19.07% of base) : 46518.dasm - System.Text.Latin1Encoding:GetByteCount(long,int):int:this
         -88 (-18.97% of base) : 54402.dasm - System.MemoryExtensions:Equals(System.ReadOnlySpan`1[System.Char],System.ReadOnlySpan`1[System.Char],int):bool
         -69 (-18.75% of base) : 58267.dasm - System.Array:Sort(System.__Canon[],System.__Canon[],int,int,System.Collections.Generic.IComparer`1[System.__Canon])

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 45569892 (overridden on cmd)
Total bytes of diff: 45394377 (overridden on cmd)
Total bytes of delta: -175515 (-0.39 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           9 : 20548.dasm (0.98% of base)
           1 : 228599.dasm (0.25% of base)

Top file improvements (bytes):
        -723 : 151634.dasm (-11.78% of base)
        -706 : 184808.dasm (-17.01% of base)
        -692 : 111901.dasm (-10.99% of base)
        -646 : 112056.dasm (-10.99% of base)
        -614 : 111909.dasm (-11.17% of base)
        -607 : 230952.dasm (-7.82% of base)
        -572 : 108072.dasm (-11.23% of base)
        -566 : 112057.dasm (-9.30% of base)
        -541 : 29654.dasm (-5.92% of base)
        -515 : 142574.dasm (-7.95% of base)
        -513 : 110583.dasm (-19.72% of base)
        -480 : 162048.dasm (-16.06% of base)
        -477 : 168049.dasm (-14.07% of base)
        -464 : 142353.dasm (-21.21% of base)
        -463 : 111943.dasm (-13.84% of base)
        -450 : 86485.dasm (-6.24% of base)
        -448 : 151635.dasm (-12.55% of base)
        -448 : 154895.dasm (-25.33% of base)
        -448 : 222774.dasm (-13.70% of base)
        -447 : 125024.dasm (-17.49% of base)

1746 total files with Code Size differences (1744 improved, 2 regressed), 0 unchanged.

Top method regressions (bytes):
           9 ( 0.98% of base) : 20548.dasm - System.Collections.Generic.ArraySortHelper`1[Vector`1][System.Numerics.Vector`1[System.Single]]:PickPivotAndPartition(System.Span`1[Vector`1],System.Comparison`1[Vector`1]):int
           1 ( 0.25% of base) : 228599.dasm - ILCompiler.DependencyAnalysisFramework.FullGraphLogStrategy`1[Byte][System.Byte]:ILCompiler.DependencyAnalysisFramework.IDependencyAnalysisMarkStrategy<DependencyContextType>.MarkNode(ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1[Byte],ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1[Byte],ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1[Byte],System.String):bool:this

Top method improvements (bytes):
        -723 (-11.78% of base) : 151634.dasm - System.Speech.Internal.SrgsParser.XmlParser:ParseGrammar(System.Xml.XmlReader,System.Speech.Internal.SrgsParser.IGrammar):this
        -706 (-17.01% of base) : 184808.dasm - System.Data.OleDb.OleDbMetaDataFactory:PrepareCollection(System.String,System.String[],System.Data.Common.DbConnection):System.Data.DataTable:this
        -692 (-10.99% of base) : 111901.dasm - System.Data.DataSet:ReadXml(System.Xml.XmlReader,bool):int:this
        -646 (-10.99% of base) : 112056.dasm - System.Data.DataTable:ReadXml(System.Xml.XmlReader,bool):int:this
        -614 (-11.17% of base) : 111909.dasm - System.Data.DataSet:ReadXml(System.Xml.XmlReader,int,bool):int:this
        -607 (-7.82% of base) : 230952.dasm - Xunit.ConsoleClient.CommandLine:Parse(System.Predicate`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]):Xunit.XunitProject:this
        -572 (-11.23% of base) : 108072.dasm - Newtonsoft.Json.Schema.JsonSchemaBuilder:ProcessSchemaProperties(Newtonsoft.Json.Linq.JObject):this
        -566 (-9.30% of base) : 112057.dasm - System.Data.DataTable:ReadXml(System.Xml.XmlReader,int,bool):int:this
        -541 (-5.92% of base) : 29654.dasm - Microsoft.CodeAnalysis.CSharp.SyntaxFacts:GetKeywordKind(System.String):ushort
        -515 (-7.95% of base) : 142574.dasm - System.Xml.Xsl.Runtime.XmlCollation:Create(System.String,bool):System.Xml.Xsl.Runtime.XmlCollation
        -513 (-19.72% of base) : 110583.dasm - System.Data.XDRSchema:FindTypeNode(System.Xml.XmlElement):System.Xml.XmlElement:this
        -480 (-16.06% of base) : 162048.dasm - Microsoft.Extensions.DependencyModel.DependencyContextJsonReader:ReadCompilationOptions(byref):Microsoft.Extensions.DependencyModel.CompilationOptions
        -477 (-14.07% of base) : 168049.dasm - Microsoft.CSharp.CSharpCodeGenerator:GetBaseTypeOutput(System.CodeDom.CodeTypeReference,bool):System.String:this
        -464 (-21.21% of base) : 142353.dasm - System.Xml.Xsl.XPath.XPathScanner:CheckAxis():int:this
        -463 (-13.84% of base) : 111943.dasm - System.Data.DataSet:ReadXmlSchema(System.Xml.XmlReader,bool):this
        -450 (-6.24% of base) : 86485.dasm - Microsoft.Diagnostics.Tracing.Parsers.ProviderManifest:ParseProviderEvents(System.Func`2[[Microsoft.Diagnostics.Tracing.Parsers.DynamicTraceEventData, Microsoft.Diagnostics.Tracing.TraceEvent, Version=2.0.65.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[Microsoft.Diagnostics.Tracing.EventFilterResponse, Microsoft.Diagnostics.Tracing.TraceEvent, Version=2.0.65.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]],bool):this
        -448 (-13.70% of base) : 222774.dasm - System.ServiceModel.Syndication.Rss20FeedFormatter:ReadMediaEnclosure(System.Xml.XmlReader,System.Uri):System.ServiceModel.Syndication.SyndicationLink:this
        -448 (-12.55% of base) : 151635.dasm - System.Speech.Internal.SrgsParser.XmlParser:ParseRule(System.Speech.Internal.SrgsParser.IGrammar,System.Xml.XmlReader):System.Speech.Internal.SrgsParser.IRule:this
        -448 (-25.33% of base) : 154895.dasm - System.Text.Json.Reflection.ReflectionExtensions:GetImmutableEnumerableConstructingTypeName(System.Type,bool):System.String
        -447 (-17.49% of base) : 125024.dasm - System.Net.Http.Headers.CacheControlHeaderValue:TrySetCacheControlValues(System.Net.Http.Headers.CacheControlHeaderValue,System.Collections.Generic.List`1[[System.Net.Http.Headers.NameValueHeaderValue, System.Net.Http, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]):bool

Top method regressions (percentages):
           9 ( 0.98% of base) : 20548.dasm - System.Collections.Generic.ArraySortHelper`1[Vector`1][System.Numerics.Vector`1[System.Single]]:PickPivotAndPartition(System.Span`1[Vector`1],System.Comparison`1[Vector`1]):int
           1 ( 0.25% of base) : 228599.dasm - ILCompiler.DependencyAnalysisFramework.FullGraphLogStrategy`1[Byte][System.Byte]:ILCompiler.DependencyAnalysisFramework.IDependencyAnalysisMarkStrategy<DependencyContextType>.MarkNode(ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1[Byte],ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1[Byte],ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1[Byte],System.String):bool:this

Top method improvements (percentages):
         -91 (-39.74% of base) : 141548.dasm - System.Xml.Xsl.XsltOld.DocumentScope:ResolveNonAtom(System.String):System.String:this
         -91 (-38.56% of base) : 185514.dasm - TagsLinkedList:Get(System.String):System.Object:this
         -94 (-36.58% of base) : 85162.dasm - Microsoft.Diagnostics.Tracing.TraceEvent:PayloadIndex(System.String):int:this
         -98 (-36.03% of base) : 151906.dasm - System.Speech.Internal.SrgsCompiler.ScriptRef:OnInitMethod(System.Speech.Internal.SrgsCompiler.ScriptRef[],System.String):System.String
         -94 (-35.34% of base) : 22044.dasm - Microsoft.CSharp.RuntimeBinder.ComInterop.ComTypeEnumDesc:HasMember(System.String):bool:this
         -94 (-35.21% of base) : 26140.dasm - Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel:FindNamedParameter(System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.CSharp.Symbols.ParameterSymbol, Microsoft.CodeAnalysis.CSharp, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],System.String):Microsoft.CodeAnalysis.CSharp.Symbols.ParameterSymbol
         -93 (-34.57% of base) : 140761.dasm - System.Xml.Xsl.Xslt.OutputScopeManager:LookupNamespace(System.String):System.String:this
         -98 (-34.39% of base) : 190401.dasm - System.DirectoryServices.SchemaNameCollection:IndexOf(System.String):int:this
         -94 (-34.06% of base) : 137331.dasm - System.Xml.XmlNodeReaderNavigator:GetDecAttrInd(System.String):int:this
         -94 (-34.06% of base) : 137335.dasm - System.Xml.XmlNodeReaderNavigator:GetDocTypeAttrInd(System.String):int:this
         -94 (-33.45% of base) : 102765.dasm - Microsoft.Diagnostics.Tracing.Ctf.CtfStruct:GetField(System.String):Microsoft.Diagnostics.Tracing.Ctf.CtfField:this
        -111 (-33.23% of base) : 231875.dasm - Xunit.Sdk.SerializationHelper:SubstringTrim(System.String,int,int):System.String
        -111 (-33.23% of base) : 233491.dasm - Xunit.Sdk.SerializationHelper:SubstringTrim(System.String,int,int):System.String
        -155 (-33.12% of base) : 140623.dasm - System.Xml.Xsl.Xslt.CompilerScopeManager`1[__Canon][System.__Canon]:SearchVariable(System.String,System.String):int:this
        -155 (-33.12% of base) : 140649.dasm - System.Xml.Xsl.Xslt.CompilerScopeManager`1[Byte][System.Byte]:SearchVariable(System.String,System.String):int:this
         -94 (-32.87% of base) : 144167.dasm - System.Xml.XPath.XPathNavigator:MoveToNamespace(System.String):bool:this
        -114 (-32.39% of base) : 203870.dasm - System.CharArrayHelpers:Trim(System.Char[],byref,byref)
        -208 (-32.25% of base) : 185381.dasm - FilterAndTransform:OnActivityStarted(System.Diagnostics.DiagnosticSourceEventSource,System.Diagnostics.Activity)
        -208 (-32.25% of base) : 185382.dasm - FilterAndTransform:OnActivityStopped(System.Diagnostics.DiagnosticSourceEventSource,System.Diagnostics.Activity)
         -94 (-32.19% of base) : 218803.dasm - System.Security.Cryptography.OidCollection:get_Item(System.String):System.Security.Cryptography.Oid:this

1746 total methods with Code Size differences (1744 improved, 2 regressed), 0 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 113764434 (overridden on cmd)
Total bytes of diff: 113596357 (overridden on cmd)
Total bytes of delta: -168077 (-0.15 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
        -741 : 339836.dasm (-13.27% of base)
        -675 : 133070.dasm (-6.82% of base)
        -614 : 11094.dasm (-10.49% of base)
        -542 : 118325.dasm (-13.65% of base)
        -534 : 243049.dasm (-15.08% of base)
        -527 : 119563.dasm (-19.04% of base)
        -518 : 256979.dasm (-7.49% of base)
        -518 : 342772.dasm (-11.55% of base)
        -493 : 124702.dasm (-25.37% of base)
        -493 : 243420.dasm (-25.37% of base)
        -493 : 117439.dasm (-25.37% of base)
        -492 : 338498.dasm (-10.59% of base)
        -489 : 321748.dasm (-9.27% of base)
        -487 : 132651.dasm (-14.98% of base)
        -469 : 106023.dasm (-23.17% of base)
        -455 : 321746.dasm (-13.03% of base)
        -454 : 338733.dasm (-6.25% of base)
        -449 : 122004.dasm (-24.48% of base)
        -448 : 329308.dasm (-25.33% of base)
        -447 : 180975.dasm (-17.49% of base)

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

Top method improvements (bytes):
        -741 (-13.27% of base) : 339836.dasm - System.Xml.Tests.ToTypeTests:TestInvalid(System.String[],System.String,System.String[]):int:this
        -675 (-6.82% of base) : 133070.dasm - Microsoft.Diagnostics.Runtime.Desktop.LockInspection:SetThreadWaiters():this
        -614 (-10.49% of base) : 11094.dasm - Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles.EditorConfigNamingStyleParser:ParseSymbolKindList(System.String):System.Collections.Immutable.ImmutableArray`1[SymbolKindOrTypeKind]
        -542 (-13.65% of base) : 118325.dasm - Microsoft.Build.Construction.ProjectParser:Parse():this
        -534 (-15.08% of base) : 243049.dasm - Microsoft.Build.Utilities.SDKManifest:ReadFileListAttributes(System.Xml.XmlAttributeCollection):this
        -527 (-19.04% of base) : 119563.dasm - Microsoft.Build.Evaluation.ExpressionShredder:GetReferencedItemExpressions(System.String,int,int):System.Collections.Generic.List`1[[Microsoft.Build.Evaluation.ExpressionShredder+ItemExpressionCapture, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]
        -518 (-7.49% of base) : 256979.dasm - NuGet.Frameworks.NuGetFramework:TryParseCommonFramework(System.String,byref):bool
        -518 (-11.55% of base) : 342772.dasm - TCWriteState:InvokeMethod(System.Xml.XmlWriter,System.String):this
        -493 (-25.37% of base) : 124702.dasm - ItemSpecModifiers:IsItemSpecModifier(System.String):bool
        -493 (-25.37% of base) : 243420.dasm - ItemSpecModifiers:IsItemSpecModifier(System.String):bool
        -493 (-25.37% of base) : 117439.dasm - ItemSpecModifiers:IsItemSpecModifier(System.String):bool
        -492 (-10.59% of base) : 338498.dasm - TCWriteState:InvokeMethod(System.Xml.XmlWriter,System.String):this
        -489 (-9.27% of base) : 321748.dasm - System.Numerics.Tests.StackCalc:DoBinaryOperatorSN(System.Numerics.BigInteger,System.Numerics.BigInteger,System.String,byref):System.Numerics.BigInteger:this
        -487 (-14.98% of base) : 132651.dasm - Microsoft.Diagnostics.Runtime.Desktop.DesktopGCHeap:InitBasicTypes():this
        -469 (-23.17% of base) : 106023.dasm - ClassWithStringPropertyConverter:Read(byref,System.Type,System.Text.Json.JsonSerializerOptions):ClassWithStringProperties:this
        -455 (-13.03% of base) : 321746.dasm - System.Numerics.Tests.StackCalc:DoUnaryOperatorSN(System.Numerics.BigInteger,System.String):System.Numerics.BigInteger:this
        -454 (-6.25% of base) : 338733.dasm - TCNamespace:TestNamespace6():this
        -449 (-24.48% of base) : 122004.dasm - Microsoft.Build.BackEnd.Logging.BaseConsoleLogger:ApplyVerbosityParameter(System.String):bool:this
        -448 (-25.33% of base) : 329308.dasm - System.Text.Json.Reflection.ReflectionExtensions:GetImmutableEnumerableConstructingTypeName(System.Type,bool):System.String
        -447 (-17.49% of base) : 180975.dasm - System.Net.Http.Headers.CacheControlHeaderValue:TrySetCacheControlValues(System.Net.Http.Headers.CacheControlHeaderValue,System.Collections.Generic.List`1[[System.Net.Http.Headers.NameValueHeaderValue, System.Net.Http.Unit.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]]):bool

Top method improvements (percentages):
        -295 (-46.68% of base) : 124703.dasm - ItemSpecModifiers:IsDefiningProjectModifier(System.String):bool
        -295 (-46.68% of base) : 117440.dasm - ItemSpecModifiers:IsDefiningProjectModifier(System.String):bool
        -295 (-46.68% of base) : 243421.dasm - ItemSpecModifiers:IsDefiningProjectModifier(System.String):bool
         -90 (-41.47% of base) : 346969.dasm - CXmlBase:_Child(System.String):CXmlBase:this
         -90 (-41.47% of base) : 214117.dasm - CXmlBase:_Child(System.String):CXmlBase:this
         -92 (-35.11% of base) : 341811.dasm - System.Xml.Tests.Utils:PositionOnElementNoDoctype(System.Xml.XmlReader,System.String)
         -86 (-34.68% of base) : 214141.dasm - CXmlNode:Attribute(System.String):CXmlAttribute:this
         -86 (-34.68% of base) : 346985.dasm - CXmlNode:Attribute(System.String):CXmlAttribute:this
         -94 (-33.33% of base) : 329407.dasm - System.Text.Json.Reflection.TypeWrapper:GetPropertyImpl(System.String,int,System.Reflection.Binder,System.Type,System.Type[],System.Reflection.ParameterModifier[]):System.Reflection.PropertyInfo:this
        -114 (-32.39% of base) : 296707.dasm - System.CharArrayHelpers:Trim(System.Char[],byref,byref)
        -114 (-32.39% of base) : 178708.dasm - System.CharArrayHelpers:Trim(System.Char[],byref,byref)
        -114 (-32.39% of base) : 227248.dasm - System.CharArrayHelpers:Trim(System.Char[],byref,byref)
        -145 (-32.15% of base) : 205590.dasm - System.ServiceModel.Syndication.Tests.XmlDiffElement:GetAttribute(System.String,System.String):System.ServiceModel.Syndication.Tests.XmlDiffAttribute:this
        -145 (-32.15% of base) : 349195.dasm - System.Xml.XmlDiff.XmlDiffElement:GetAttribute(System.String,System.String):System.Xml.XmlDiff.XmlDiffAttribute:this
        -103 (-31.60% of base) : 216520.dasm - System.Data.Common.DbConnectionOptions:GetKeyValue(System.Text.StringBuilder,bool):System.String
        -103 (-31.60% of base) : 220820.dasm - System.Data.Common.DbConnectionOptions:GetKeyValue(System.Text.StringBuilder,bool):System.String
         -84 (-31.58% of base) : 309755.dasm - System.Collections.ObjectModel.Tests.CollectionAndPropertyChangedTester:Collection_PropertyChanged(System.Object,System.ComponentModel.PropertyChangedEventArgs):this
         -85 (-31.14% of base) : 329336.dasm - System.Text.Json.Reflection.TypeExtensions:GetCompatibleBaseClass(System.Type,System.String):System.Type
        -110 (-30.81% of base) : 257368.dasm - StringSegment:CreateTrimmed(System.String,int,int):StringSegment
         -94 (-30.23% of base) : 245647.dasm - Microsoft.DotNet.ProjectModel.ProjectExtensions:GetSourceCodeLanguage(Microsoft.DotNet.ProjectModel.Project):System.String

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


@AndyAyersMS
Copy link
Member Author

Sample diffs

;; Assembly listing for method Microsoft.CodeAnalysis.CSharp.DiagnosticsPass:IsInterlockedAPI(Microsoft.CodeAnalysis.CSharp.Symbol):bool:this

;; before

G_M7814_IG03:        ; gcrefRegs=000000C0 {rsi rdi}, byrefRegs=00000000 {}, byref, isz
       ; gcrRegs -[rax]
       mov      rcx, rsi
       ; gcrRegs +[rcx]
       mov      rax, qword ptr [rsi]
       mov      rax, qword ptr [rax+80]
       call     [rax+56]hackishModuleName:hackishMethodName():Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol:this
       ; gcrRegs -[rcx rsi] +[rax]
       ; gcr arg pop 0
       test     rax, rax
       jne      SHORT G_M7814_IG04
       xor      esi, esi
       je       SHORT G_M7814_IG07
       jmp      SHORT G_M7814_IG05
						;; bbWeight=0.50 PerfScore 5.88
G_M7814_IG04:        ; gcrefRegs=00000081 {rax rdi}, byrefRegs=00000000 {}, byref, isz
       cmp      rdi, rax
       je       SHORT G_M7814_IG05

;; after

G_M7814_IG03:        ; gcrefRegs=000000C0 {rsi rdi}, byrefRegs=00000000 {}, byref, isz
       ; gcrRegs -[rax]
       mov      rcx, rsi
       ; gcrRegs +[rcx]
       mov      rax, qword ptr [rsi]
       mov      rax, qword ptr [rax+80]
       call     [rax+56]hackishModuleName:hackishMethodName():Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol:this
       ; gcrRegs -[rcx rsi] +[rax]
       ; gcr arg pop 0
       test     rax, rax
       je       SHORT G_M7814_IG06
       cmp      rdi, rax
       je       SHORT G_M7814_IG04

Here's a fairly common pattern. Haven't yet mapped this back to see where it comes from.

;; Assembly listing for method System.Threading.ThreadPool:UnsafeQueueUserWorkItem(System.Action`1[Byte],ubyte,bool):bool

;; before

       mov      r14, rax
       ; gcrRegs +[r14]
       mov      ecx, 1
       mov      rdx, 0xD1FFAB1E      ; string handle
       mov      rdx, gword ptr [rdx]
       ; gcrRegs +[rdx]
       test     ecx, ecx
       jne      SHORT G_M35947_IG04
						;; bbWeight=1    PerfScore 14.50
G_M35947_IG03:        ; gcrefRegs=00004064 {rdx rbp rsi r14}, byrefRegs=00000000 {}, byref
       ; gcrRegs -[rax]
       mov      rcx, rdx
       ; gcrRegs +[rcx]
       call     hackishModuleName:hackishMethodName()
       ; gcrRegs -[rcx rdx]
       ; gcr arg pop 0
						;; bbWeight=0.50 PerfScore 0.62
G_M35947_IG04:        ; gcrefRegs=00004060 {rbp rsi r14}, byrefRegs=00000000 {}, byref
       lea      rcx, bword ptr [r14+16]

;; after

       mov      r14, rax
       ; gcrRegs +[r14]
       lea      rcx, bword ptr [r14+16]

@jakobbotsch
Copy link
Member

Haven't yet mapped this back to see where it comes from.

It's also a little curious that there are so many more PMI diffs compared to crossgen2 diffs, do you know why?

@AndyAyersMS
Copy link
Member Author

It's also a little curious that there are so many more PMI diffs compared to crossgen2 diffs, do you know why?

No, I don't. Could be we're seeing a runtime idiom that is hidden/abstracted in R2R. Or else the patterns in R2R are just different. I'll see if I can track this down.

@EgorBo
Copy link
Member

EgorBo commented Oct 27, 2021

Haven't yet mapped this back to see where it comes from.

It's also a little curious that there are so many more PMI diffs compared to crossgen2 diffs, do you know why?

because of generics? like every generic call-site is instantiated with one of 8 predefined types in PMI mode (or I am wrong?)

@AndyAyersMS
Copy link
Member Author

Hmm, the second pattern above looks like it comes (in part) from Debug.Assert in an inlinee:

internal static void UnsafeQueueUserWorkItemInternal(object callBack, bool preferLocal)
{
Debug.Assert((callBack is IThreadPoolWorkItem) ^ (callBack is Task));
s_workQueue.Enqueue(callBack, forceGlobal: !preferLocal);
}

So perhaps the diffs here are overstated as we're evidently doing a PMI collection of a checked SPC?

We really need to make sure we're not capturing checked SPC methods as part of SPMI.

@AndyAyersMS
Copy link
Member Author

Let me run regular PMI diffs here and see what it says...

@AndyAyersMS
Copy link
Member Author

PMI diffs suggest that many of the sizeable diffs above are indeed from eliminating various Debug.Assert constructs in a checked SPC.

PMI CodeSize Diffs for System.Private.CoreLib.dll, framework assemblies for x64 default jit

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 61482371
Total bytes of diff: 61477946
Total bytes of delta: -4425 (-0.01 % of base)
Total relative delta: -3.82
    diff is an improvement.
    relative diff is an improvement.


Total byte diff includes -47 bytes from reconciling methods
        Base had    1 unique methods,       47 unique bytes
        Diff had    0 unique methods,        0 unique bytes

Top file improvements (bytes):
       -2004 : System.Memory.dasm (-0.70% of base)
        -841 : Microsoft.CodeAnalysis.VisualBasic.dasm (-0.01% of base)
        -708 : System.Text.Json.dasm (-0.07% of base)
        -574 : Microsoft.CodeAnalysis.CSharp.dasm (-0.01% of base)
        -242 : System.Runtime.Numerics.dasm (-0.26% of base)
         -43 : System.IO.Pipelines.dasm (-0.05% of base)
         -10 : System.Security.Cryptography.Pkcs.dasm (-0.00% of base)
          -3 : System.Configuration.ConfigurationManager.dasm (-0.00% of base)

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

Top method regressions (bytes):
          47 (10.00% of base) : System.Private.CoreLib.dasm - <>c:<InitializeTlsBucketsAndTrimming>b__13_0(Object):bool:this (10 methods)

Top method improvements (bytes):
        -408 (-12.41% of base) : System.Memory.dasm - <>c:<ToString>b__33_0(Span`1,ReadOnlySequence`1):this (8 methods)
        -287 (-14.14% of base) : System.Memory.dasm - SequenceMarshal:TryGetReadOnlyMemory(ReadOnlySequence`1,byref):bool (8 methods)
        -252 (-8.77% of base) : System.Memory.dasm - SequenceReader`1:TryReadToAnySlow(byref,ReadOnlySpan`1,bool):bool:this (6 methods)
        -252 (-9.07% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,ReadOnlySpan`1,bool):bool:this (6 methods)
        -216 (-2.62% of base) : System.Memory.dasm - SequenceReader`1:TryReadTo(byref,ReadOnlySpan`1,bool):bool:this (12 methods)
        -168 (-10.36% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):Vector`1
        -165 (-12.01% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):__Canon
        -165 (-10.49% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):Nullable`1
        -131 (-8.19% of base) : System.Runtime.Numerics.dasm - BigInteger:ModPow(BigInteger,BigInteger,BigInteger):BigInteger
        -121 (-9.75% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):double
        -100 (-11.07% of base) : System.Runtime.Numerics.dasm - BigInteger:GreatestCommonDivisor(BigInteger,BigInteger):BigInteger
         -96 (-7.45% of base) : System.Text.Json.dasm - JsonDocument:Parse(ReadOnlySequence`1,JsonDocumentOptions):JsonDocument
         -77 (-10.35% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):long
         -69 (-6.49% of base) : Microsoft.CodeAnalysis.CSharp.dasm - BoundForEachStatement:Update(ForEachEnumeratorInfo,Conversion,BoundTypeExpression,LocalSymbol,BoundExpression,BoundStatement,bool,GeneratedLabelSymbol,GeneratedLabelSymbol):BoundForEachStatement:this
         -67 (-6.05% of base) : System.Text.Json.dasm - Utf8JsonReader:TryGetGuidCore(byref):bool:this
         -58 (-5.38% of base) : System.Text.Json.dasm - Utf8JsonReader:TryGetDateTimeCore(byref):bool:this
         -55 (-10.17% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):int
         -55 (-4.50% of base) : System.Text.Json.dasm - JsonReaderHelper:UnescapeAndCompare(ReadOnlySequence`1,ReadOnlySpan`1):bool
         -53 (-4.87% of base) : System.Text.Json.dasm - Utf8JsonReader:TryGetDateTimeOffsetCore(byref):bool:this
         -51 (-2.22% of base) : System.Text.Json.dasm - Utf8JsonReader:UnescapeSequenceAndCompare(ReadOnlySpan`1):bool:this

Top method regressions (percentages):
          47 (10.00% of base) : System.Private.CoreLib.dasm - <>c:<InitializeTlsBucketsAndTrimming>b__13_0(Object):bool:this (10 methods)

Top method improvements (percentages):
         -47 (-100.00% of base) : System.Private.CoreLib.dasm -
        -287 (-14.14% of base) : System.Memory.dasm - SequenceMarshal:TryGetReadOnlyMemory(ReadOnlySequence`1,byref):bool (8 methods)
        -408 (-12.41% of base) : System.Memory.dasm - <>c:<ToString>b__33_0(Span`1,ReadOnlySequence`1):this (8 methods)
        -165 (-12.01% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):__Canon
        -100 (-11.07% of base) : System.Runtime.Numerics.dasm - BigInteger:GreatestCommonDivisor(BigInteger,BigInteger):BigInteger
        -165 (-10.49% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):Nullable`1
        -168 (-10.36% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):Vector`1
         -77 (-10.35% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):long
         -55 (-10.17% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):int
        -121 (-9.75% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):double
         -33 (-9.46% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):short
        -252 (-9.07% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,ReadOnlySpan`1,bool):bool:this (6 methods)
         -22 (-8.91% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - Conversions:ToGenericParameter(Object):ubyte
         -42 (-8.79% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,int,bool):bool:this
         -42 (-8.79% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,long,bool):bool:this
        -252 (-8.77% of base) : System.Memory.dasm - SequenceReader`1:TryReadToAnySlow(byref,ReadOnlySpan`1,bool):bool:this (6 methods)
         -42 (-8.73% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,double,bool):bool:this
         -42 (-8.71% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,short,bool):bool:this
         -42 (-8.70% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,ubyte,bool):bool:this
         -42 (-8.70% of base) : System.Memory.dasm - SequenceReader`1:TryReadToSlow(byref,Vector`1,bool):bool:this

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

@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib ping -- this is still interesting, just not as impactful as it first seemed.

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM. You should probably trigger outerloop and/or jitstress pipelines

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS AndyAyersMS merged commit 5a108e8 into dotnet:main Oct 29, 2021
@AndyAyersMS AndyAyersMS deleted the VNRelopRelop branch October 29, 2021 02:25
@ghost ghost locked as resolved and limited conversation to collaborators Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants