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

Handle direct addresses for statics in IsFieldAddr #64846

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Feb 5, 2022

This change improves IsFieldAddr to recognize statics with known constant addresses, such as those for object-typed fields.

We are expecting some nice CSE-related diffs.

Part of CLS_VAR deletion.

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

ghost commented Feb 5, 2022

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

Issue Details

This change improves IsFieldAddr to recognize statics with known constant addresses, such as those for object-typed fields.

We are expecting some nice CSE-related diffs.

Part of CLS_VAR deletion.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@SingleAccretion SingleAccretion force-pushed the Improve-Handling-Of-Type-Mismatch-In-VN-Part-Ten branch from e310ee6 to f38f503 Compare February 5, 2022 11:58
@SingleAccretion SingleAccretion changed the title Handle direct addresses in IsFieldAddr Handle direct addresses for statics in IsFieldAddr Feb 5, 2022
@SingleAccretion SingleAccretion force-pushed the Improve-Handling-Of-Type-Mismatch-In-VN-Part-Ten branch 2 times, most recently from e451dfd to 32ed889 Compare February 5, 2022 18:08
src/coreclr/jit/compiler.cpp Outdated Show resolved Hide resolved
@SingleAccretion
Copy link
Contributor Author

Diffs - obtained using the same SPMI trick as in #62632. We'll need a recollection once/if this change is merged.

We see some size regressions in ARM64 collections, I've looked at some, nothing stands out (more CSEs -> not always better), and the overall PerfScore diff is positive:

PerfScore diff for win-arm64, libraries.pmi
Found 364 files with textual diffs.

Summary of Perf Score diffs:
(Lower is better)

Total PerfScoreUnits of base: 2315400.380000004
Total PerfScoreUnits of diff: 2314022.3
Total PerfScoreUnits of delta: -1378.08 (-0.06 % of base)
Total relative delta: -6.77
    diff is an improvement.
    relative diff is an improvement.


Top file regressions (PerfScoreUnits):
       29.30 : 54853.dasm (0.04% of base)
        9.50 : 25157.dasm (0.05% of base)
        8.55 : 136021.dasm (3.37% of base)
        6.25 : 22771.dasm (0.26% of base)
        5.30 : 237556.dasm (4.34% of base)
        4.80 : 30616.dasm (2.41% of base)
        4.45 : 234199.dasm (0.90% of base)
        3.85 : 110434.dasm (3.38% of base)
        3.80 : 48813.dasm (1.38% of base)
        3.45 : 168937.dasm (3.95% of base)
        3.20 : 48774.dasm (1.46% of base)
        3.15 : 131745.dasm (4.78% of base)
        3.15 : 131746.dasm (4.78% of base)
        2.95 : 134507.dasm (0.55% of base)
        2.70 : 176677.dasm (2.39% of base)
        2.70 : 134962.dasm (1.05% of base)
        2.70 : 134518.dasm (0.68% of base)
        2.45 : 210102.dasm (1.61% of base)
        2.40 : 133741.dasm (1.25% of base)
        2.30 : 222109.dasm (1.08% of base)

Top file improvements (PerfScoreUnits):
     -241.80 : 134950.dasm (-12.43% of base)
      -99.80 : 134139.dasm (-11.03% of base)
      -35.60 : 42737.dasm (-0.31% of base)
      -24.70 : 125300.dasm (-7.42% of base)
      -19.90 : 181803.dasm (-0.11% of base)
      -16.80 : 159386.dasm (-0.81% of base)
      -15.60 : 52883.dasm (-0.74% of base)
      -15.60 : 42396.dasm (-0.74% of base)
      -14.10 : 126538.dasm (-5.87% of base)
      -13.90 : 136347.dasm (-11.94% of base)
      -13.19 : 72984.dasm (-13.06% of base)
      -12.50 : 131742.dasm (-1.40% of base)
      -11.30 : 53113.dasm (-2.45% of base)
      -10.94 : 228678.dasm (-6.77% of base)
      -10.94 : 228681.dasm (-6.77% of base)
       -9.65 : 239261.dasm (-0.67% of base)
       -9.60 : 115941.dasm (-2.54% of base)
       -9.55 : 41955.dasm (-6.17% of base)
       -9.50 : 139230.dasm (-2.45% of base)
       -9.39 : 52330.dasm (-6.08% of base)

357 total files with Perf Score differences (306 improved, 51 regressed), 7 unchanged.

Top method regressions (PerfScoreUnits):
       29.30 ( 0.04% of base) : 54853.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser:Parse(System.Collections.Generic.IEnumerable`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],System.String,System.String,System.String):Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineArguments:this
        9.50 ( 0.05% of base) : 25157.dasm - Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser:Parse(System.Collections.Generic.IEnumerable`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],System.String,System.String,System.String):Microsoft.CodeAnalysis.CSharp.CSharpCommandLineArguments:this
        8.55 ( 3.37% of base) : 136021.dasm - System.Xml.Xsl.XPath.XPathQilFactory:ConvertToString(System.Xml.Xsl.Qil.QilNode):System.Xml.Xsl.Qil.QilNode:this
        6.25 ( 0.26% of base) : 22771.dasm - Microsoft.CodeAnalysis.CSharp.Binder:ResultSymbol(Microsoft.CodeAnalysis.CSharp.LookupResult,System.String,int,Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode,Microsoft.CodeAnalysis.DiagnosticBag,bool,byref,Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceOrTypeSymbol,int):Microsoft.CodeAnalysis.CSharp.Symbol:this
        5.30 ( 4.34% of base) : 237556.dasm - System.Threading.Barrier:FinishPhase(bool):this
        4.80 ( 2.41% of base) : 30616.dasm - Microsoft.CodeAnalysis.CSharp.BoundTreeDumperNodeProducer:VisitEventAccess(Microsoft.CodeAnalysis.CSharp.BoundEventAccess,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        4.45 ( 0.90% of base) : 234199.dasm - System.Text.RegularExpressions.Symbolic.BDD:TopologicalSort():System.Text.RegularExpressions.Symbolic.BDD[]:this
        3.85 ( 3.38% of base) : 110434.dasm - Microsoft.Build.BackEnd.NodeProviderOutOfProcTaskHost:GetMSBuildLocationFromHostContext(int):System.String
        3.80 ( 1.38% of base) : 48813.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitDoLoopStatement(Microsoft.CodeAnalysis.VisualBasic.BoundDoLoopStatement,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        3.45 ( 3.95% of base) : 168937.dasm - System.ComponentModel.Composition.Primitives.ImportDefinition:.ctor(System.String,int,bool,bool,System.Collections.Generic.IDictionary`2[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]):this
        3.20 ( 1.46% of base) : 48774.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitQueryableSource(Microsoft.CodeAnalysis.VisualBasic.BoundQueryableSource,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        3.15 ( 4.78% of base) : 131745.dasm - System.Xml.Schema.DatatypeImplementation:GetNormalizedStringTypeV1Compat():System.Xml.Schema.XmlSchemaSimpleType
        3.15 ( 4.78% of base) : 131746.dasm - System.Xml.Schema.DatatypeImplementation:GetTokenTypeV1Compat():System.Xml.Schema.XmlSchemaSimpleType
        2.95 ( 0.55% of base) : 134507.dasm - System.Xml.Xsl.Xslt.QilGenerator:CreateGeneralKeyFunction():System.Xml.Xsl.Qil.QilFunction:this
        2.70 ( 2.39% of base) : 176677.dasm - System.Data.OleDb.ColumnBinding:Value_IDISPATCH(System.Object):this
        2.70 ( 0.68% of base) : 134518.dasm - System.Xml.Xsl.Xslt.QilGenerator:CompileLetterValueAttribute(System.String,bool):System.Xml.Xsl.Qil.QilNode:this
        2.70 ( 1.05% of base) : 134962.dasm - System.Xml.Xsl.Xslt.XsltQilFactory:InvokeRegisterDecimalFormat(System.Xml.Xsl.Xslt.DecimalFormatDecl):System.Xml.Xsl.Qil.QilNode:this
        2.45 ( 1.61% of base) : 210102.dasm - System.Net.Sockets.DynamicWinsockMethods:GetMethods(int,int,int):System.Net.Sockets.DynamicWinsockMethods
        2.40 ( 1.25% of base) : 133741.dasm - System.Xml.Schema.XsdDateTime:PrintZone(System.Text.StringBuilder):this
        2.30 ( 1.03% of base) : 48865.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitFieldAccess(Microsoft.CodeAnalysis.VisualBasic.BoundFieldAccess,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this

Top method improvements (PerfScoreUnits):
     -241.80 (-12.43% of base) : 134950.dasm - System.Xml.Xsl.Xslt.XsltLoader:.ctor():this
      -99.80 (-11.03% of base) : 134139.dasm - System.Xml.Xsl.XmlQueryType:CreateTypeCodeDerivation():BitMatrix
      -35.60 (-0.31% of base) : 42737.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol:AddNonTypeMembers(MembersAndInitializersBuilder,Microsoft.CodeAnalysis.SyntaxList`1[[Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax, Microsoft.CodeAnalysis.CSharp, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.CodeAnalysis.DiagnosticBag):this
      -24.70 (-7.42% of base) : 125300.dasm - MS.Internal.Xml.Cache.XPathDocumentNavigator:get_UniqueId():System.String:this
      -19.90 (-0.11% of base) : 181803.dasm - System.DirectoryServices.AccountManagement.ADStoreCtx:LoadPropertyMappingTable(int,System.Object[,])
      -16.80 (-0.81% of base) : 159386.dasm - R2RTest.CompileSerpCommand:.ctor(R2RTest.BuildOptions):this
      -15.60 (-0.74% of base) : 52883.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceAssemblySymbol:LoadAndValidateNetModuleAttributes(byref):this
      -15.60 (-0.74% of base) : 42396.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol:LoadAndValidateNetModuleAttributes(byref):this
      -14.10 (-5.87% of base) : 126538.dasm - System.Xml.XmlSqlBinaryReader:GenerateTokenTypeMap():System.Type[]:this
      -13.90 (-11.94% of base) : 136347.dasm - System.Xml.Xsl.Runtime.XmlNavTypeFilter:CreateTypeFilters():System.Xml.Xsl.Runtime.XmlNavigatorFilter[]
      -13.19 (-13.06% of base) : 72984.dasm - ConstructedSymbol:get_TypeArgumentsNoUseSiteDiagnostics():System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
      -12.50 (-1.40% of base) : 131742.dasm - System.Xml.Schema.DatatypeImplementation:CreateBuiltinTypes()
      -11.30 (-2.45% of base) : 53113.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceMemberContainerTypeSymbol:ReportInterfaceUnificationError(Microsoft.CodeAnalysis.DiagnosticBag,Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol,Microsoft.CodeAnalysis.VisualBasic.Symbols.NamedTypeSymbol):this
      -10.94 (-6.77% of base) : 228681.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertALaw2Linear(System.Byte[],int):System.Int16[]
      -10.94 (-6.77% of base) : 228678.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertULaw2Linear(System.Byte[],int):System.Int16[]
       -9.65 (-0.67% of base) : 239261.dasm - ILCompiler.CommandLineOptions:.ctor(System.String[]):this
       -9.60 (-2.54% of base) : 115941.dasm - System.Data.DataSet:GetXmlSchemaForRemoting(System.Data.DataTable):System.String:this
       -9.55 (-6.17% of base) : 41955.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MetadataOrSourceAssemblySymbol:GetDeclaredSpecialTypeMember(int):Microsoft.CodeAnalysis.CSharp.Symbol:this
       -9.50 (-2.45% of base) : 139230.dasm - System.Xml.Serialization.XmlSchemaExporter:ExportEnumMapping(System.Xml.Serialization.EnumMapping,System.String):System.Xml.Schema.XmlSchemaType:this
       -9.39 (-6.08% of base) : 52330.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.MetadataOrSourceAssemblySymbol:GetDeclaredSpecialTypeMember(int):Microsoft.CodeAnalysis.VisualBasic.Symbol:this

Top method regressions (percentages):
        3.15 ( 4.78% of base) : 131745.dasm - System.Xml.Schema.DatatypeImplementation:GetNormalizedStringTypeV1Compat():System.Xml.Schema.XmlSchemaSimpleType
        3.15 ( 4.78% of base) : 131746.dasm - System.Xml.Schema.DatatypeImplementation:GetTokenTypeV1Compat():System.Xml.Schema.XmlSchemaSimpleType
        5.30 ( 4.34% of base) : 237556.dasm - System.Threading.Barrier:FinishPhase(bool):this
        3.45 ( 3.95% of base) : 168937.dasm - System.ComponentModel.Composition.Primitives.ImportDefinition:.ctor(System.String,int,bool,bool,System.Collections.Generic.IDictionary`2[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]):this
        3.85 ( 3.38% of base) : 110434.dasm - Microsoft.Build.BackEnd.NodeProviderOutOfProcTaskHost:GetMSBuildLocationFromHostContext(int):System.String
        8.55 ( 3.37% of base) : 136021.dasm - System.Xml.Xsl.XPath.XPathQilFactory:ConvertToString(System.Xml.Xsl.Qil.QilNode):System.Xml.Xsl.Qil.QilNode:this
        4.80 ( 2.41% of base) : 30616.dasm - Microsoft.CodeAnalysis.CSharp.BoundTreeDumperNodeProducer:VisitEventAccess(Microsoft.CodeAnalysis.CSharp.BoundEventAccess,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        2.70 ( 2.39% of base) : 176677.dasm - System.Data.OleDb.ColumnBinding:Value_IDISPATCH(System.Object):this
        1.70 ( 2.09% of base) : 164404.dasm - System.Collections.Immutable.ImmutableQueue:Create(System.Numerics.Vector`1[Single]):System.Collections.Immutable.ImmutableQueue`1[Vector`1]
        1.10 ( 1.76% of base) : 102333.dasm - Microsoft.Diagnostics.Tracing.Analysis.GC.ServerGcHistory:.ctor():this
        2.10 ( 1.66% of base) : 48856.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitAnonymousTypePropertyAccess(Microsoft.CodeAnalysis.VisualBasic.BoundAnonymousTypePropertyAccess,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        2.10 ( 1.66% of base) : 48829.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitLocal(Microsoft.CodeAnalysis.VisualBasic.BoundLocal,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        2.45 ( 1.61% of base) : 210102.dasm - System.Net.Sockets.DynamicWinsockMethods:GetMethods(int,int,int):System.Net.Sockets.DynamicWinsockMethods
        1.30 ( 1.58% of base) : 158232.dasm - System.CommandLine.Parsing.ParseOperation:.ctor(System.CommandLine.Parsing.TokenizeResult,System.CommandLine.CommandLineConfiguration):this
        3.20 ( 1.46% of base) : 48774.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitQueryableSource(Microsoft.CodeAnalysis.VisualBasic.BoundQueryableSource,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        3.80 ( 1.38% of base) : 48813.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeDumperNodeProducer:VisitDoLoopStatement(Microsoft.CodeAnalysis.VisualBasic.BoundDoLoopStatement,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        2.40 ( 1.25% of base) : 133741.dasm - System.Xml.Schema.XsdDateTime:PrintZone(System.Text.StringBuilder):this
        2.10 ( 1.24% of base) : 30660.dasm - Microsoft.CodeAnalysis.CSharp.BoundTreeDumperNodeProducer:VisitDelegateCreationExpression(Microsoft.CodeAnalysis.CSharp.BoundDelegateCreationExpression,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        2.10 ( 1.24% of base) : 30615.dasm - Microsoft.CodeAnalysis.CSharp.BoundTreeDumperNodeProducer:VisitPropertyAccess(Microsoft.CodeAnalysis.CSharp.BoundPropertyAccess,System.Object):Microsoft.CodeAnalysis.TreeDumperNode:this
        2.30 ( 1.08% of base) : 222109.dasm - System.Security.Cryptography.Xml.SignedXml:BuildBagOfCerts():System.Security.Cryptography.X509Certificates.X509Certificate2Collection:this

Top method improvements (percentages):
       -6.60 (-14.70% of base) : 132865.dasm - System.Xml.Schema.XmlSchemaElement:.ctor():this
      -13.19 (-13.06% of base) : 72984.dasm - ConstructedSymbol:get_TypeArgumentsNoUseSiteDiagnostics():System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:this
     -241.80 (-12.43% of base) : 134950.dasm - System.Xml.Xsl.Xslt.XsltLoader:.ctor():this
      -13.90 (-11.94% of base) : 136347.dasm - System.Xml.Xsl.Runtime.XmlNavTypeFilter:CreateTypeFilters():System.Xml.Xsl.Runtime.XmlNavigatorFilter[]
       -4.10 (-11.85% of base) : 132696.dasm - System.Xml.Schema.XmlSchemaAttribute:.ctor():this
      -99.80 (-11.03% of base) : 134139.dasm - System.Xml.Xsl.XmlQueryType:CreateTypeCodeDerivation():BitMatrix
       -5.20 (-8.30% of base) : 8349.dasm - Microsoft.FSharp.Collections.SetTreeModule:compare(System.Collections.Generic.IComparer`1[Byte],Microsoft.FSharp.Collections.SetTree`1[Byte],Microsoft.FSharp.Collections.SetTree`1[Byte]):int
       -6.60 (-8.10% of base) : 181346.dasm - System.DirectoryServices.AccountManagement.PrincipalCollection:.ctor(System.DirectoryServices.AccountManagement.BookmarkableResultSet,System.DirectoryServices.AccountManagement.GroupPrincipal):this
      -24.70 (-7.42% of base) : 125300.dasm - MS.Internal.Xml.Cache.XPathDocumentNavigator:get_UniqueId():System.String:this
       -4.10 (-7.26% of base) : 108600.dasm - Microsoft.Build.Construction.SolutionFile:.ctor():this
      -10.94 (-6.77% of base) : 228681.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertALaw2Linear(System.Byte[],int):System.Int16[]
      -10.94 (-6.77% of base) : 228678.dasm - System.Speech.Internal.Synthesis.AudioFormatConverter:ConvertULaw2Linear(System.Byte[],int):System.Int16[]
       -6.20 (-6.67% of base) : 6501.dasm - Microsoft.FSharp.Quotations.PatternsModule:mkFE3(Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr):Microsoft.FSharp.Quotations.FSharpExpr
       -7.70 (-6.24% of base) : 176770.dasm - System.Data.OleDb.Bindings:set_MaxLen(int):this
       -6.60 (-6.19% of base) : 159816.dasm - System.CodeDom.CodeMemberProperty:.ctor():this
       -9.55 (-6.17% of base) : 41955.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.MetadataOrSourceAssemblySymbol:GetDeclaredSpecialTypeMember(int):Microsoft.CodeAnalysis.CSharp.Symbol:this
       -9.39 (-6.08% of base) : 52330.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.MetadataOrSourceAssemblySymbol:GetDeclaredSpecialTypeMember(int):Microsoft.CodeAnalysis.VisualBasic.Symbol:this
       -2.30 (-5.92% of base) : 152856.dasm - Microsoft.Extensions.FileProviders.Physical.Internal.PathUtils:EnsureTrailingSlash(System.String):System.String
      -14.10 (-5.87% of base) : 126538.dasm - System.Xml.XmlSqlBinaryReader:GenerateTokenTypeMap():System.Type[]:this
       -3.55 (-5.82% of base) : 135223.dasm - System.Xml.Xsl.XsltOld.ContainerAction:EnsureCopyCodeAction():this

357 total methods with Perf Score differences (306 improved, 51 regressed), 7 unchanged.

--------------------------------------------------------------------------------
PerfScore diff for win-arm64, libraries_tests.pmi
Found 797 files with textual diffs.

Summary of Perf Score diffs:
(Lower is better)

Total PerfScoreUnits of base: 2133819396.6700027
Total PerfScoreUnits of diff: 2133816329.6200035
Total PerfScoreUnits of delta: -3067.05 (-0.00 % of base)
Total relative delta: -23.21
    diff is an improvement.
    relative diff is an improvement.


Top file regressions (PerfScoreUnits):
      182.90 : 319787.dasm (1.09% of base)
       29.20 : 235152.dasm (2.31% of base)
       10.80 : 202902.dasm (0.42% of base)
        9.20 : 297288.dasm (0.61% of base)
        8.45 : 224074.dasm (0.36% of base)
        6.70 : 278739.dasm (1.39% of base)
        5.80 : 151669.dasm (1.22% of base)
        4.85 : 341805.dasm (0.37% of base)
        4.25 : 266214.dasm (2.42% of base)
        4.25 : 266222.dasm (2.44% of base)
        4.25 : 266317.dasm (2.42% of base)
        4.25 : 266383.dasm (2.42% of base)
        4.25 : 266402.dasm (2.42% of base)
        4.10 : 260578.dasm (0.08% of base)
        3.80 : 278740.dasm (0.85% of base)
        3.80 : 278951.dasm (0.98% of base)
        3.65 : 260620.dasm (1.24% of base)
        3.60 : 266325.dasm (2.06% of base)
        3.60 : 266363.dasm (2.06% of base)
        3.60 : 266376.dasm (2.06% of base)

Top file improvements (PerfScoreUnits):
     -125.60 : 5511.dasm (-8.95% of base)
     -124.80 : 29003.dasm (-10.14% of base)
     -124.80 : 29088.dasm (-10.14% of base)
     -124.80 : 29172.dasm (-8.31% of base)
      -81.35 : 4987.dasm (-25.10% of base)
      -77.20 : 69360.dasm (-64.33% of base)
      -53.60 : 298133.dasm (-39.01% of base)
      -51.75 : 29169.dasm (-28.42% of base)
      -42.30 : 5510.dasm (-7.40% of base)
      -37.40 : 34990.dasm (-2.66% of base)
      -32.90 : 139576.dasm (-2.88% of base)
      -28.80 : 5508.dasm (-3.95% of base)
      -27.20 : 132467.dasm (-11.00% of base)
      -27.20 : 115556.dasm (-11.00% of base)
      -26.60 : 302823.dasm (-5.15% of base)
      -23.40 : 171744.dasm (-12.79% of base)
      -22.40 : 5544.dasm (-2.73% of base)
      -22.40 : 5537.dasm (-2.71% of base)
      -22.40 : 5489.dasm (-3.03% of base)
      -21.90 : 250189.dasm (-9.91% of base)

796 total files with Perf Score differences (711 improved, 85 regressed), 1 unchanged.

Top method regressions (PerfScoreUnits):
      182.90 ( 1.09% of base) : 319787.dasm - System.Numerics.Tests.Driver:RunTests()
       29.20 ( 2.31% of base) : 235152.dasm - Microsoft.DotNet.ProjectModel.Graph.LockFile:IsValidForProject(Microsoft.DotNet.ProjectModel.Project,byref):bool:this
       10.80 ( 0.42% of base) : 202902.dasm - System.Threading.Tasks.Tests.FromAsync.TaskFromAsyncTest:RunAPMTest():System.Threading.Tasks.Tests.AsyncWork:this
        9.20 ( 0.61% of base) : 297288.dasm - <Alpn_TestData>d__15:MoveNext():bool:this
        8.45 ( 0.36% of base) : 224074.dasm - <>c__DisplayClass40_0:<UseInstance>b__0(Registry):Registry:this
        6.70 ( 1.39% of base) : 278739.dasm - System.IO.Tests.FileSystemWatcherTests_netstandard17:SynchronizingObject_CalledOnEvent(int):this
        5.80 ( 1.22% of base) : 151669.dasm - BasicEventSourceTests.TestEventCounter:Test_Write_Metric(BasicEventSourceTests.Listener):this
        4.85 ( 0.37% of base) : 341805.dasm - System.Xml.Tests.TC_SchemaSet_Compile:TFS_470021():this
        4.25 ( 2.42% of base) : 266214.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.44% of base) : 266222.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266317.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266383.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266402.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.10 ( 0.08% of base) : 260578.dasm - System.Collections.Immutable.Tests.ImmutableListTestBase:SortTest():this
        3.80 ( 0.98% of base) : 278951.dasm - System.IO.Tests.FileSystemWatcherTests:FileSystemWatcher_OnRenamed():this
        3.80 ( 0.85% of base) : 278740.dasm - System.IO.Tests.FileSystemWatcherTests_netstandard17:SynchronizingObject_CalledOnRenamed():this
        3.65 ( 1.24% of base) : 260620.dasm - System.Collections.Immutable.Tests.ImmutableListTest:AddRange_IOrderedCollection():this
        3.60 ( 2.06% of base) : 266325.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        3.60 ( 2.06% of base) : 266363.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        3.60 ( 2.06% of base) : 266376.dasm - <Equals_TestData>d__1:MoveNext():bool:this

Top method improvements (PerfScoreUnits):
     -125.60 (-8.95% of base) : 5511.dasm - Microsoft.CodeAnalysis.Collections.Internal.SegmentedGenericArraySortHelper`1[Byte][System.Byte]:InsertionSort(Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySegment`1[Byte])
     -124.80 (-10.14% of base) : 29088.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.returnType.covariant.method001.method001.Test:MainMethod(System.String[]):int
     -124.80 (-10.14% of base) : 29003.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.returnType.covariant.property001.property001.Test:MainMethod(System.String[]):int
     -124.80 (-8.31% of base) : 29172.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.returnType.covariant.indexer001.indexer001.Test:MainMethod(System.String[]):int
      -81.35 (-25.10% of base) : 4987.dasm - Microsoft.CodeAnalysis.Collections.SegmentedArray:Reverse(Microsoft.CodeAnalysis.Collections.SegmentedArray`1[Byte],int,int)
      -77.20 (-64.33% of base) : 69360.dasm - System.Tests.ObjectTests:ReferenceEqualsTest()
      -53.60 (-39.01% of base) : 298133.dasm - System.Net.Tests.WebClientTest:UseDefaultCredentials_Roundtrips()
      -51.75 (-28.42% of base) : 29169.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.returnType.covariant.indexer001.indexer001.Derive2Object:TestSimpleCall():bool:this
      -42.30 (-7.40% of base) : 5510.dasm - Microsoft.CodeAnalysis.Collections.Internal.SegmentedGenericArraySortHelper`1[Byte][System.Byte]:DownHeap(Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySegment`1[Byte],int,int,int)
      -37.40 (-2.66% of base) : 34990.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.context.dlgateEvent.dlgate.dlgate001.dlgate001.nms.Start:MainMethod():int
      -32.90 (-2.88% of base) : 139576.dasm - <>c__DisplayClass164_0:<OutputAttributeDeclarations_NonEmptyAttributes_Success>b__0(System.IO.StringWriter):this
      -28.80 (-3.95% of base) : 5508.dasm - Microsoft.CodeAnalysis.Collections.Internal.SegmentedGenericArraySortHelper`1[Byte][System.Byte]:PickPivotAndPartition(Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySegment`1[Byte]):int
      -27.20 (-11.00% of base) : 132467.dasm - NuGet.Packaging.PackageBuilder:EncodeHexString(System.Byte[]):System.String
      -27.20 (-11.00% of base) : 115556.dasm - System.Deployment.Internal.CodeSigning.SignedCmiManifest2:BytesToHexString(System.Byte[],int,int):System.String
      -26.60 (-5.15% of base) : 302823.dasm - System.Collections.ObjectModel.Tests.KeyedCollectionTests:ChangeItemKey_OnThresholdOfCreation_Success():this
      -23.40 (-12.79% of base) : 171744.dasm - System.Buffers.Text.Tests.Base64TestHelper:GenerateDecodingMapAndVerify()
      -22.40 (-2.73% of base) : 5544.dasm - Microsoft.CodeAnalysis.Collections.Internal.SegmentedGenericArraySortHelper`2[Byte,Nullable`1][System.Byte,System.Nullable`1[System.Int32]]:HeapSort(Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySegment`1[Byte],System.Span`1[Nullable`1])
      -22.40 (-3.03% of base) : 5489.dasm - Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySortHelper`1[Byte][System.Byte]:HeapSort(Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySegment`1[Byte],System.Comparison`1[Byte])
      -22.40 (-2.71% of base) : 5537.dasm - Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySortHelper`2[Byte,Nullable`1][System.Byte,System.Nullable`1[System.Int32]]:HeapSort(Microsoft.CodeAnalysis.Collections.Internal.SegmentedArraySegment`1[Byte],System.Span`1[Nullable`1],System.Collections.Generic.IComparer`1[Byte])
      -21.90 (-9.91% of base) : 250189.dasm - NuGet.ProjectModel.LockFileTargetLibrary:.ctor():this

Top method regressions (percentages):
        2.50 ( 8.96% of base) : 303938.dasm - <>c:<.cctor>b__16_0():System.Collections.Generic.KeyValuePair`2[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]:this
        2.20 ( 2.64% of base) : 139583.dasm - <>c__DisplayClass169_0:<OutputDirection_Invoke_Success>b__0(System.IO.StringWriter):this
        2.20 ( 2.64% of base) : 139586.dasm - <>c__DisplayClass172_0:<OutputFieldScopeModifier_Invoke_Success>b__0(System.IO.StringWriter):this
        2.20 ( 2.64% of base) : 139588.dasm - <>c__DisplayClass175_0:<OutputIdentifier_InvokeWithOutput_Appends>b__0(System.IO.StringWriter):this
        2.20 ( 2.64% of base) : 139590.dasm - <>c__DisplayClass177_0:<OutputMemberAccessModifier_Invoke_Success>b__0(System.IO.StringWriter):this
        2.20 ( 2.64% of base) : 139593.dasm - <>c__DisplayClass180_0:<OutputMemberScopeModifier_Invoke_Success>b__0(System.IO.StringWriter):this
        2.20 ( 2.64% of base) : 139595.dasm - <>c__DisplayClass183_0:<OutputOperator_Invoke_Success>b__0(System.IO.StringWriter):this
        2.20 ( 2.44% of base) : 139608.dasm - <>c__DisplayClass194_0:<OutputTypeAttributes_Invoke_Success>b__0(System.IO.StringWriter):this
        4.25 ( 2.44% of base) : 266222.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266214.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266317.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266383.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        4.25 ( 2.42% of base) : 266402.dasm - <Equals_TestData>d__1:MoveNext():bool:this
       29.20 ( 2.31% of base) : 235152.dasm - Microsoft.DotNet.ProjectModel.Graph.LockFile:IsValidForProject(Microsoft.DotNet.ProjectModel.Project,byref):bool:this
        3.60 ( 2.06% of base) : 266325.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        3.60 ( 2.06% of base) : 266363.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        3.60 ( 2.06% of base) : 266376.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        3.60 ( 2.06% of base) : 266390.dasm - <Equals_TestData>d__1:MoveNext():bool:this
        3.00 ( 2.04% of base) : 98950.dasm - <ValidGuidTests>d__1:MoveNext():bool:this
        1.35 ( 1.48% of base) : 242339.dasm - <>c:<Initialize>b__8_7(Microsoft.CodeAnalysis.SourceProductionContext,System.ValueTuple`2[[System.ValueTuple`3[[Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[Microsoft.Interop.TargetFramework, Microsoft.Interop.SourceGeneration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Version, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Collections.Immutable.ImmutableArray`1[[<>f__AnonymousType0`2[[Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax, Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[Microsoft.CodeAnalysis.IMethodSymbol, Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.Interop.DllImportGenerator, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Collections.Immutable, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]):this

Top method improvements (percentages):
      -77.20 (-64.33% of base) : 69360.dasm - System.Tests.ObjectTests:ReferenceEqualsTest()
      -53.60 (-39.01% of base) : 298133.dasm - System.Net.Tests.WebClientTest:UseDefaultCredentials_Roundtrips()
      -51.75 (-28.42% of base) : 29169.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.returnType.covariant.indexer001.indexer001.Derive2Object:TestSimpleCall():bool:this
       -7.75 (-25.29% of base) : 32024.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.declarations.backwardscompatible.dynamictypedeclared009.dynamictypedeclared009.Test:MainMethod():int
      -81.35 (-25.10% of base) : 4987.dasm - Microsoft.CodeAnalysis.Collections.SegmentedArray:Reverse(Microsoft.CodeAnalysis.Collections.SegmentedArray`1[Byte],int,int)
       -5.90 (-23.27% of base) : 30998.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.classes.abstract003.abstract003.Test:MainMethod(System.String[]):int
      -12.80 (-22.90% of base) : 295599.dasm - <>c:<CredentialPolicy_Roundtrip>b__6_0():this
       -7.30 (-17.49% of base) : 30348.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.formalParameter.param004.param004.Test:MainMethod(System.String[]):int
      -11.60 (-16.13% of base) : 30672.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.dynamicobj001.dynamicobj001.Test:MainMethod():int
      -11.10 (-15.31% of base) : 222122.dasm - ImTools.ImHashMapSlots:CreateWithEmpty(int):ImTools.ImHashMap`2[System.Byte,System.Nullable`1[System.Int32]][]
      -11.10 (-15.31% of base) : 221669.dasm - ImTools.ImMapSlots:CreateWithEmpty(int):ImTools.ImMap`1[System.Byte][]
       -2.50 (-14.79% of base) : 104715.dasm - ClassIncorrectHashCode:GetHashCode():int:this
      -23.40 (-12.79% of base) : 171744.dasm - System.Buffers.Text.Tests.Base64TestHelper:GenerateDecodingMapAndVerify()
       -7.80 (-12.62% of base) : 128109.dasm - Microsoft.Diagnostics.Runtime.Utilities.Pdb.PdbFile:FindFunction(Microsoft.Diagnostics.Runtime.Utilities.Pdb.PdbFunction[],ushort,int):int
      -11.10 (-12.47% of base) : 231062.dasm - LightInject.ImmutableHashTable`2[Byte,Nullable`1][System.Byte,System.Nullable`1[System.Int32]]:InitializeBuckets(int,int):this
      -11.10 (-12.18% of base) : 113350.dasm - Grace.DependencyInjection.Impl.ActivationStrategyDelegateCache:.ctor():this
      -21.60 (-12.01% of base) : 143163.dasm - SupportedImportCollectionMutation`1[Byte][System.Byte]:.ctor():this
      -11.10 (-11.88% of base) : 231064.dasm - LightInject.ImmutableHashTable`2[Byte,Nullable`1][System.Byte,System.Nullable`1[System.Int32]]:.ctor():this
      -18.60 (-11.73% of base) : 171743.dasm - System.Buffers.Text.Tests.Base64TestHelper:GenerateEncodingMapAndVerify()
       -2.50 (-11.42% of base) : 27370.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.namedandoptional.usage.executeOrder.nested01.nested01.Test:Bar1():int

796 total methods with Perf Score differences (711 improved, 85 regressed), 1 unchanged.

--------------------------------------------------------------------------------

Notably, there were cases in tests where we lost some CQ because constant propagation loses field sequences, and thus instead of uniform ByrefExposedLoad VNs we would have MapSelect + ByrefExposedLoad for the static. Fixing that would be possible, but as the number of such cases was small, and they were in test code, I will defer that (tracked in #64876).

@SingleAccretion SingleAccretion marked this pull request as ready for review February 6, 2022 21:41
@SingleAccretion
Copy link
Contributor Author

OSX x64 timeouts are not related (happening everywhere), Linux x64 failure is #61359.

@dotnet/jit-contrib

@SingleAccretion SingleAccretion force-pushed the Improve-Handling-Of-Type-Mismatch-In-VN-Part-Ten branch from 7615206 to 7f06e13 Compare February 12, 2022 10:20
@JulieLeeMSFT JulieLeeMSFT added this to the 7.0.0 milestone Feb 16, 2022
Allows this change to be tested via SPMI.
This reverts commit b17817e0354a63319256a0fa0d21b74c2cfbf781.
@SingleAccretion SingleAccretion force-pushed the Improve-Handling-Of-Type-Mismatch-In-VN-Part-Ten branch from 7f06e13 to 848169f Compare February 23, 2022 13:31
@kunalspathak
Copy link
Member

Latest asmdiff CI doesn't show any diffs. Do you know why?

@SingleAccretion
Copy link
Contributor Author

@kunalspathak That's expected. This change leads to lots of MISSING errors because we are now calling the isFieldStatic API where we previously didn't.

That's why I needed that field info commit to obtain the diffs, it caches the "is static" information from importation and avoids calling isFieldStatic.

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

LGTM. I will kick off a new SPMI collection.

@kunalspathak kunalspathak merged commit b3465af into dotnet:main Feb 24, 2022
@SingleAccretion SingleAccretion deleted the Improve-Handling-Of-Type-Mismatch-In-VN-Part-Ten branch February 25, 2022 19:09
@kunalspathak
Copy link
Member

Nice improvements in dotnet/perf-autofiling-issues#3834

@AndyAyersMS
Copy link
Member

@ghost ghost locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants