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

Optimize indirection cell call sequences more generally #59602

Merged
merged 4 commits into from
Oct 15, 2021

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Sep 25, 2021

Currently we apply an optimization for ARM architectures where we make
sure we do not duplicate instructions to compute the target address for
calls that involve indirection cells, instead loading it from the
indirection cell directly. We can apply this optimization for x64 VSD
and tailcalls that also use indirection cells. This decreases the size
of these calls.

I have also included a bug fix for ARM/ARM64: the optimization was only
enabled under FEATURE_READYTORUN which is not always defined (e.g. in
single-file scenarios).

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 25, 2021
@ghost
Copy link

ghost commented Sep 25, 2021

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

Issue Details

Currently we apply an optimization for R2R ARM architectures where we
make sure we do not duplicate instructions to compute the target address
for calls that involve indirection cells, instead loading it from the
indirection cell directly. We can apply this optimization more generally
during runtime JIT as well, and also for x64 VSD that also uses
indirection cells. This decreases the size of ARM/ARM64 runtime VSD
calls and x64 prejit/runtime VSD calls.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch

This comment has been minimized.

@jakobbotsch jakobbotsch added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Sep 25, 2021
Currently we apply an optimization for ARM architectures where we make
sure we do not duplicate instructions to compute the target address for
calls that involve indirection cells, instead loading it from the
indirection cell directly. We can apply this optimization for x64 VSD
and tailcalls that also use indirection cells. This decreases the size
of these calls.

I have also included a bug fix for ARM/ARM64: the optimization was only
enabled under FEATURE_READYTORUN which is not always defined (e.g. in
single-file scenarios).
@jakobbotsch jakobbotsch force-pushed the optimize-vsd-sequences branch from b342729 to 9f898e1 Compare October 8, 2021 10:14
@jakobbotsch jakobbotsch removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 8, 2021
@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch
Copy link
Member Author

Failures are #57621, #60152 and #57903.

@jakobbotsch
Copy link
Member Author

This should be ready, PTAL @dotnet/jit-contrib. The diffs are substantial (-2% code size on x64 crossgen libs).
No diffs on arm64 as expected since it already has these optimizations (except for the single-exe scenario that I fixed).

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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 11963364 (overridden on cmd)
Total bytes of diff: 11898545 (overridden on cmd)
Total bytes of delta: -64819 (-0.54 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          17 : 35354.dasm (0.75% of base)

Top file improvements (bytes):
        -360 : 17786.dasm (-1.52% of base)
        -360 : 26625.dasm (-6.73% of base)
        -360 : 36969.dasm (-3.49% of base)
        -266 : 37966.dasm (-6.44% of base)
        -262 : 27382.dasm (-6.32% of base)
        -257 : 37488.dasm (-4.78% of base)
        -254 : 26972.dasm (-4.74% of base)
        -240 : 18395.dasm (-2.10% of base)
        -237 : 18937.dasm (-2.50% of base)
        -213 : 28043.dasm (-2.55% of base)
        -213 : 38882.dasm (-2.56% of base)
        -210 : 27473.dasm (-4.07% of base)
        -210 : 38060.dasm (-4.10% of base)
        -192 : 19049.dasm (-1.90% of base)
        -172 : 38143.dasm (-3.55% of base)
        -172 : 27552.dasm (-3.54% of base)
        -165 : 37985.dasm (-6.31% of base)
        -165 : 27401.dasm (-6.42% of base)
        -153 : 20012.dasm (-1.54% of base)
        -150 : 18956.dasm (-2.38% of base)

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

Top method regressions (bytes):
          17 ( 0.75% of base) : 35354.dasm - <MultiplexingWriteLoop>d__20:MoveNext():this

Top method improvements (bytes):
        -360 (-1.52% of base) : 17786.dasm - ProviderConventionSetBuilder:CreateConventionSet():ConventionSet:this
        -360 (-6.73% of base) : 26625.dasm - ProviderConventionSetBuilder:CreateConventionSet():ConventionSet:this
        -360 (-3.49% of base) : 36969.dasm - ProviderConventionSetBuilder:CreateConventionSet():ConventionSet:this
        -266 (-6.44% of base) : 37966.dasm - ModelValidator:ValidateData(IModel,IDiagnosticsLogger`1):this
        -262 (-6.32% of base) : 27382.dasm - ModelValidator:ValidateData(IModel,IDiagnosticsLogger`1):this
        -257 (-4.78% of base) : 37488.dasm - RelationshipDiscoveryConvention:CreateRelationships(IEnumerable`1,IConventionEntityTypeBuilder):this
        -254 (-4.74% of base) : 26972.dasm - RelationshipDiscoveryConvention:CreateRelationships(IEnumerable`1,IConventionEntityTypeBuilder):this
        -240 (-2.10% of base) : 18395.dasm - RelationshipDiscoveryConvention:CreateRelationships(IEnumerable`1,IConventionEntityTypeBuilder):this
        -237 (-2.50% of base) : 18937.dasm - ModelValidator:ValidateData(IModel,IDiagnosticsLogger`1):this
        -213 (-2.55% of base) : 28043.dasm - SelectExpression:.ctor(IEntityType,ISqlExpressionFactory):this
        -213 (-2.56% of base) : 38882.dasm - SelectExpression:.ctor(IEntityType,ISqlExpressionFactory):this
        -210 (-4.07% of base) : 27473.dasm - RelationalModel:PopulateConstraints(Table)
        -210 (-4.10% of base) : 38060.dasm - RelationalModel:PopulateConstraints(Table)
        -192 (-1.90% of base) : 19049.dasm - RelationalModel:PopulateConstraints(Table)
        -172 (-3.55% of base) : 38143.dasm - SlimModelConvention:Create(IModel):SlimModel:this
        -172 (-3.54% of base) : 27552.dasm - SlimModelConvention:Create(IModel):SlimModel:this
        -165 (-6.31% of base) : 37985.dasm - RelationalModelValidator:ValidateDbFunctions(IModel,IDiagnosticsLogger`1):this
        -165 (-6.42% of base) : 27401.dasm - RelationalModelValidator:ValidateDbFunctions(IModel,IDiagnosticsLogger`1):this
        -153 (-1.54% of base) : 20012.dasm - SelectExpression:.ctor(IEntityType,ISqlExpressionFactory):this
        -150 (-2.38% of base) : 18956.dasm - RelationalModelValidator:ValidateDbFunctions(IModel,IDiagnosticsLogger`1):this

Top method regressions (percentages):
          17 ( 0.75% of base) : 35354.dasm - <MultiplexingWriteLoop>d__20:MoveNext():this

Top method improvements (percentages):
          -3 (-18.75% of base) : 39749.dasm - DbContextDependenciesExtensions:GetDependencies(ICurrentDbContext):IDbContextDependencies
          -3 (-18.75% of base) : 39548.dasm - DiagnosticsLogger`1:ShouldLog(EventDefinitionBase):bool:this
          -3 (-15.79% of base) : 27982.dasm - <>c:<.cctor>b__185_1(IGrouping`2):String:this
          -3 (-15.79% of base) : 26408.dasm - <>c:<.ctor>b__5_0(IInterceptorAggregator):Type:this
          -3 (-15.79% of base) : 39530.dasm - <>c:<.ctor>b__5_0(IInterceptorAggregator):Type:this
          -3 (-15.79% of base) : 27509.dasm - <>c:<For>b__2_1(IColumnMapping):IProperty:this
          -3 (-15.79% of base) : 28061.dasm - <>c:<GetAllPropertiesInHierarchy>b__108_0(IEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27084.dasm - <>c:<ProcessEntityTypePrimaryKeyChanged>b__24_1(IConventionEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27074.dasm - <>c:<ProcessKeyAdded>b__22_0(IConventionEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27077.dasm - <>c:<ProcessKeyAdded>b__8_0(IConventionEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27421.dasm - <>c:<ValidateIndexIncludeProperties>b__4_0(IEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27349.dasm - <>c:<ValidateNoShadowKeys>b__11_0(IConventionProperty):bool:this
          -3 (-15.79% of base) : 27336.dasm - <>c:<ValidatePropertyMapping>b__7_3(IConventionProperty):String:this
          -3 (-15.79% of base) : 27411.dasm - <>c:<ValidateSharedForeignKeysCompatibility>b__17_0(IEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27413.dasm - <>c:<ValidateSharedIndexesCompatibility>b__19_0(IEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27409.dasm - <>c:<ValidateSharedKeysCompatibility>b__21_0(IEntityType):IEnumerable`1:this
          -3 (-15.79% of base) : 27587.dasm - <>c__6`2:<CreateAnnotations>b__6_0(IAnnotation):String:this
          -3 (-15.79% of base) : 27588.dasm - <>c__6`2:<CreateAnnotations>b__6_1(IAnnotation):Object:this
          -3 (-15.00% of base) : 34010.dasm - <>c__DisplayClass211_0:<GenerateDeserializerFromMap>b__0(int):String:this
          -3 (-15.00% of base) : 34024.dasm - <>c__DisplayClass211_0:<GenerateDeserializerFromMap>b__2(String):IMemberMap:this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 124752864 (overridden on cmd)
Total bytes of diff: 124744590 (overridden on cmd)
Total bytes of delta: -8274 (-0.01 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
        -108 : 243676.dasm (-5.34% of base)
         -88 : 212860.dasm (-3.65% of base)
         -87 : 212859.dasm (-3.65% of base)
         -66 : 243656.dasm (-6.36% of base)
         -58 : 212861.dasm (-5.07% of base)
         -54 : 247615.dasm (-4.81% of base)
         -54 : 223689.dasm (-1.82% of base)
         -51 : 228763.dasm (-2.23% of base)
         -48 : 219415.dasm (-4.87% of base)
         -48 : 249881.dasm (-2.48% of base)
         -45 : 192567.dasm (-1.20% of base)
         -39 : 247617.dasm (-3.54% of base)
         -39 : 223594.dasm (-1.38% of base)
         -39 : 234373.dasm (-0.67% of base)
         -36 : 209646.dasm (-2.55% of base)
         -36 : 243624.dasm (-1.87% of base)
         -36 : 209655.dasm (-0.70% of base)
         -36 : 209644.dasm (-1.31% of base)
         -36 : 228837.dasm (-1.27% of base)
         -36 : 223584.dasm (-4.16% of base)

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

Top method improvements (bytes):
        -108 (-5.34% of base) : 243676.dasm - Program:SingleOverride()
         -88 (-3.65% of base) : 212860.dasm - NetClient.StringTests:Marshal_LPWString():this
         -87 (-3.65% of base) : 212859.dasm - NetClient.StringTests:Marshal_LPString():this
         -66 (-6.36% of base) : 243656.dasm - Program:Main():int
         -58 (-5.07% of base) : 212861.dasm - NetClient.StringTests:Marshal_BStrString():this
         -54 (-1.82% of base) : 223689.dasm - <TEST_MultipleSessionsCanBeStartedWhilepaused>d__2:MoveNext():this
         -54 (-4.81% of base) : 247615.dasm - test:Main():int
         -51 (-2.23% of base) : 228763.dasm - Span.IndexerBench:Main(System.String[]):int
         -48 (-2.48% of base) : 249881.dasm - HelloWorld:Main(System.String[]):int
         -48 (-4.87% of base) : 219415.dasm - Span.SpanBench:Main(System.String[]):int
         -45 (-1.20% of base) : 192567.dasm - ABIStress.Program:Main(System.String[]):int
         -39 (-0.67% of base) : 234373.dasm - ScanProjectFiles:ParseAndUpdateProj(System.String,bool):bool
         -39 (-1.38% of base) : 223594.dasm - SoDBench.Program:LaunchProcess(System.Diagnostics.ProcessStartInfo,int,System.Collections.Generic.IDictionary`2[[System.String, 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]])
         -39 (-3.54% of base) : 247617.dasm - test:Main():int
         -36 (-1.27% of base) : 228837.dasm - BenchmarkConsoleApplication.BenchmarkSystem:RunBenchmark(BenchmarkConsoleApplication.Benchmark):BenchmarkConsoleApplication.Results:this
         -36 (-1.87% of base) : 243624.dasm - CTest:Main():int
         -36 (-0.70% of base) : 209655.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeAutoFieldLayout(Internal.TypeSystem.MetadataType,int):Internal.TypeSystem.ComputedInstanceFieldLayout:this
         -36 (-1.31% of base) : 209644.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeInstanceLayout(Internal.TypeSystem.DefType,int):Internal.TypeSystem.ComputedInstanceFieldLayout:this
         -36 (-2.55% of base) : 209646.dasm - Internal.TypeSystem.MetadataFieldLayoutAlgorithm:ComputeStaticFieldLayout(Internal.TypeSystem.DefType,int):Internal.TypeSystem.ComputedStaticFieldLayout:this
         -36 (-4.16% of base) : 223584.dasm - SoDBench.SizeReportingNode:.ctor(System.IO.DirectoryInfo,System.Nullable`1[Int32]):this

Top method improvements (percentages):
          -3 (-18.75% of base) : 224100.dasm - IDynamicInterfaceCastableTests.BadDynamicInterfaceCastable:UseOther(IDynamicInterfaceCastableTests.IOther):int
          -3 (-18.75% of base) : 246391.dasm - MyClass:TestInterfaceMethod(IMyInterface,System.String):System.String
          -3 (-18.75% of base) : 251252.dasm - MyClass:TestInterfaceMethod(IMyInterface,System.String):System.String
          -3 (-18.75% of base) : 83749.dasm - Program:DoWork(IMyInterface`1[Byte]):int
          -3 (-18.75% of base) : 86704.dasm - RemoteBase_InSeparateAssembly:UseIProtected(IProtected_InSeparateAssembly):System.String
          -3 (-18.75% of base) : 83779.dasm - T:F(I`1[[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]):System.Object
          -3 (-18.75% of base) : 254239.dasm - Z:Hi(Iz):int
          -3 (-18.75% of base) : 254238.dasm - Z:Hz(Iz):int
          -3 (-18.75% of base) : 254231.dasm - Z:IxF(Ix):int
          -3 (-18.75% of base) : 254232.dasm - Z:IxG(Ix):int
          -3 (-15.79% of base) : 239742.dasm - <>c:<DataflowBench>b__8_0(Microsoft.CodeAnalysis.ISymbol):System.String:this
          -3 (-15.00% of base) : 223882.dasm - GCSimulator.ObjectLifeTimeManager:AddObject(GCSimulator.LifeTime,int):this
          -3 (-15.00% of base) : 223881.dasm - GCSimulator.ObjectLifeTimeManager:Init(int):this
          -3 (-15.00% of base) : 223856.dasm - LifeTimeFX.ObjectLifeTimeManager:AddObject(LifeTimeFX.LifeTime,int):this
          -3 (-15.00% of base) : 223855.dasm - LifeTimeFX.ObjectLifeTimeManager:Init(int):this
          -3 (-15.00% of base) : 252513.dasm - MyCollection`1[__Canon][System.__Canon]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-15.00% of base) : 252521.dasm - MyCollection`1[Byte][System.Byte]:get_IsReadOnly():bool:this
          -3 (-15.00% of base) : 252523.dasm - MyCollection`1[Byte][System.Byte]:GetEnumerator():System.Collections.Generic.IEnumerator`1[Byte]:this
          -3 (-15.00% of base) : 252524.dasm - MyCollection`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-15.00% of base) : 228623.dasm - System.Collections.Concurrent.IProducerConsumerCollection_DebugView`1[Byte][System.Byte]:get_Values():System.Byte[]:this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 34857039 (overridden on cmd)
Total bytes of diff: 34165859 (overridden on cmd)
Total bytes of delta: -691180 (-1.98 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
       -1083 : 27505.dasm (-2.22% of base)
        -840 : 210319.dasm (-4.33% of base)
        -822 : 193868.dasm (-8.30% of base)
        -771 : 210308.dasm (-5.79% of base)
        -691 : 34431.dasm (-3.34% of base)
        -681 : 210273.dasm (-5.32% of base)
        -603 : 129869.dasm (-11.70% of base)
        -573 : 98418.dasm (-4.03% of base)
        -561 : 210336.dasm (-5.54% of base)
        -502 : 117925.dasm (-1.89% of base)
        -495 : 124115.dasm (-7.89% of base)
        -480 : 92814.dasm (-7.46% of base)
        -441 : 210268.dasm (-5.47% of base)
        -438 : 139250.dasm (-3.46% of base)
        -411 : 58872.dasm (-3.67% of base)
        -403 : 90904.dasm (-1.95% of base)
        -402 : 210270.dasm (-4.65% of base)
        -381 : 172880.dasm (-11.16% of base)
        -366 : 163649.dasm (-4.55% of base)
        -363 : 91149.dasm (-7.82% of base)

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

Top method improvements (bytes):
       -1083 (-2.22% of base) : 27505.dasm - Microsoft.Diagnostics.Tracing.CtfTraceEventSource:InitEventMap():System.Collections.Generic.Dictionary`2[System.String, Microsoft.Diagnostics.Tracing.ETWMapping]
        -840 (-4.33% of base) : 210319.dasm - System.Management.ManagementClassGenerator:GenerateMethods():this
        -822 (-8.30% of base) : 193868.dasm - CultureInfoMapper:CreateMap():System.Collections.Generic.Dictionary`2[System.String, System.String]
        -771 (-5.79% of base) : 210308.dasm - System.Management.ManagementClassGenerator:GenerateTypeConverterClass():System.CodeDom.CodeTypeDeclaration:this
        -691 (-3.34% of base) : 34431.dasm - Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter:ConvExprToLinqInContext(Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter+ConvEnv,Microsoft.FSharp.Quotations.FSharpExpr):System.Linq.Expressions.Expression
        -681 (-5.32% of base) : 210273.dasm - System.Management.ManagementClassGenerator:AddToDateTimeFunction():this
        -603 (-11.70% of base) : 129869.dasm - System.Reflection.PortableExecutable.PEHeader:.ctor(byref):this
        -573 (-4.03% of base) : 98418.dasm - System.Data.XmlTreeGen:HandleTable(System.Data.DataTable,System.Xml.XmlDocument,System.Xml.XmlElement,bool):System.Xml.XmlElement:this
        -561 (-5.54% of base) : 210336.dasm - System.Management.ManagementClassGenerator:GenerateProperties():this
        -502 (-1.89% of base) : 117925.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser:Parse(System.Collections.Generic.IEnumerable`1[System.String],System.String,System.String,System.String):Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineArguments:this
        -495 (-7.89% of base) : 124115.dasm - Microsoft.CodeAnalysis.VisualBasic.BoundTreeVisitor`2:VisitInternal(Microsoft.CodeAnalysis.VisualBasic.BoundNode,System.__Canon):System.__Canon:this
        -480 (-7.46% of base) : 92814.dasm - Microsoft.CodeAnalysis.CSharp.Binder:FoldNeverOverflowBinaryOperators(int,Microsoft.CodeAnalysis.ConstantValue,Microsoft.CodeAnalysis.ConstantValue):System.Object
        -441 (-5.47% of base) : 210268.dasm - System.Management.ManagementClassGenerator:AddToTimeSpanFunction():this
        -438 (-3.46% of base) : 139250.dasm - System.DirectoryServices.ActiveDirectory.Utils:GetReplicaList(System.DirectoryServices.ActiveDirectory.DirectoryContext,System.String,System.String,bool,bool,bool):System.Collections.ArrayList
        -411 (-3.67% of base) : 58872.dasm - System.Xml.Schema.SchemaNames:.ctor(System.Xml.XmlNameTable):this
        -403 (-1.95% of base) : 90904.dasm - Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser:Parse(System.Collections.Generic.IEnumerable`1[System.String],System.String,System.String,System.String):Microsoft.CodeAnalysis.CSharp.CSharpCommandLineArguments:this
        -402 (-4.65% of base) : 210270.dasm - System.Management.ManagementClassGenerator:AddToDMTFDateTimeFunction():this
        -381 (-11.16% of base) : 172880.dasm - System.Security.Cryptography.X509Certificates.X509Certificate2:ToString(bool):System.String:this
        -366 (-4.55% of base) : 163649.dasm - System.Configuration.ConfigurationElement:DeserializeElement(System.Xml.XmlReader,bool):this
        -363 (-7.82% of base) : 91149.dasm - Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor`2:VisitInternal(Microsoft.CodeAnalysis.CSharp.BoundNode,System.__Canon):System.__Canon:this

Top method improvements (percentages):
          -3 (-23.08% of base) : 102654.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsMe(Microsoft.CodeAnalysis.IParameterSymbol):bool
          -3 (-23.08% of base) : 102655.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsMustOverride(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-23.08% of base) : 102656.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsNotOverridable(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-23.08% of base) : 102657.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsOverridable(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-23.08% of base) : 102658.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsOverrides(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-23.08% of base) : 102659.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsShared(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-23.08% of base) : 30976.dasm - Microsoft.FSharp.Collections.IEnumerator:dispose(System.IDisposable)
          -3 (-23.08% of base) : 38306.dasm - Newtonsoft.Json.Linq.JToken:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-23.08% of base) : 172489.dasm - System.Collections.Concurrent.BlockingCollection`1:CopyTo(System.__Canon[],int):this
          -3 (-23.08% of base) : 162387.dasm - System.Configuration.Provider.ProviderCollection:CopyTo(System.Configuration.Provider.ProviderBase[],int):this
          -3 (-23.08% of base) : 94176.dasm - System.Data.Common.DbDataAdapter:set_DeleteCommand(System.Data.Common.DbCommand):this
          -3 (-23.08% of base) : 94170.dasm - System.Data.Common.DbDataAdapter:set_InsertCommand(System.Data.Common.DbCommand):this
          -3 (-23.08% of base) : 94166.dasm - System.Data.Common.DbDataAdapter:set_SelectCommand(System.Data.Common.DbCommand):this
          -3 (-23.08% of base) : 94161.dasm - System.Data.Common.DbDataAdapter:set_UpdateCommand(System.Data.Common.DbCommand):this
          -3 (-23.08% of base) : 94056.dasm - System.Data.Common.DbParameter:get_Precision():ubyte:this
          -3 (-23.08% of base) : 94054.dasm - System.Data.Common.DbParameter:get_Scale():ubyte:this
          -3 (-23.08% of base) : 207223.dasm - System.Diagnostics.EventLogEntryCollection:CopyTo(System.Diagnostics.EventLogEntry[],int):this
          -3 (-23.08% of base) : 169435.dasm - System.Diagnostics.TraceListenerCollection:Contains(System.Diagnostics.TraceListener):bool:this
          -3 (-23.08% of base) : 169434.dasm - System.Diagnostics.TraceListenerCollection:CopyTo(System.Diagnostics.TraceListener[],int):this
          -3 (-23.08% of base) : 169431.dasm - System.Diagnostics.TraceListenerCollection:IndexOf(System.Diagnostics.TraceListener):int:this

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


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 45408221 (overridden on cmd)
Total bytes of diff: 45259992 (overridden on cmd)
Total bytes of delta: -148229 (-0.33 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           2 : 174230.dasm (0.39% of base)
           1 : 20823.dasm (0.11% of base)

Top file improvements (bytes):
        -255 : 201573.dasm (-1.50% of base)
        -190 : 138192.dasm (-4.95% of base)
        -189 : 168037.dasm (-4.23% of base)
        -189 : 201549.dasm (-1.29% of base)
        -186 : 232090.dasm (-4.20% of base)
        -183 : 231592.dasm (-4.16% of base)
        -168 : 102337.dasm (-4.73% of base)
        -160 : 83447.dasm (-6.46% of base)
        -160 : 27776.dasm (-2.21% of base)
        -159 : 78270.dasm (-3.53% of base)
        -157 : 168030.dasm (-1.45% of base)
        -153 : 83448.dasm (-5.15% of base)
        -151 : 140423.dasm (-3.40% of base)
        -150 : 137494.dasm (-4.17% of base)
        -147 : 204412.dasm (-3.42% of base)
        -144 : 104562.dasm (-5.08% of base)
        -141 : 201562.dasm (-0.71% of base)
        -138 : 108839.dasm (-2.48% of base)
        -138 : 168020.dasm (-2.09% of base)
        -132 : 53500.dasm (-1.57% of base)

17631 total files with Code Size differences (17629 improved, 2 regressed), 12 unchanged.

Top method regressions (bytes):
           2 ( 0.39% of base) : 174230.dasm - Node[Vector`1][System.Numerics.Vector`1[System.Single]]:Remove(System.Numerics.Vector`1[Single],System.Collections.Generic.IComparer`1[Vector`1],byref):Node[Vector`1]:this
           1 ( 0.11% of base) : 20823.dasm - CollectionsMarshalHelper[Int32,Nullable`1][System.Int32,System.Nullable`1[System.Int32]]:GetValueRefOrAddDefault(System.Collections.Generic.Dictionary`2[Int32,Nullable`1],int,byref):byref

Top method improvements (bytes):
        -255 (-1.50% of base) : 201573.dasm - System.Management.ManagementClassGenerator:GenerateTypeConverterClass():System.CodeDom.CodeTypeDeclaration:this
        -190 (-4.95% of base) : 138192.dasm - System.Xml.Schema.SchemaCollectionCompiler:Compile():this
        -189 (-4.23% of base) : 168037.dasm - R2RTest.BuildFolderSet:WriteCombinedLog(System.String):this
        -189 (-1.29% of base) : 201549.dasm - System.Management.ManagementClassGenerator:AddToDateTimeFunction():this
        -186 (-4.20% of base) : 232090.dasm - <AfterTestCaseStartingAsync>d__9:MoveNext():this
        -183 (-4.16% of base) : 231592.dasm - Xunit.Sdk.TheoryDiscoverer:Discover(Xunit.Abstractions.ITestFrameworkDiscoveryOptions,Xunit.Abstractions.ITestMethod,Xunit.Abstractions.IAttributeInfo):System.Collections.Generic.IEnumerable`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]]:this
        -168 (-4.73% of base) : 102337.dasm - Microsoft.VisualBasic.CompilerServices.ObjectType:ObjTst(System.Object,System.Object,bool):int
        -160 (-2.21% of base) : 27776.dasm - Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor:VisitMethod(Microsoft.CodeAnalysis.IMethodSymbol):this
        -160 (-6.46% of base) : 83447.dasm - Microsoft.Diagnostics.Tracing.Etlx.TraceLog:FastSerialization.IFastSerializable.ToStream(FastSerialization.Serializer):this
        -159 (-3.53% of base) : 78270.dasm - Microsoft.CodeAnalysis.Emit.DeltaMetadataWriter:CreateIndicesForNonTypeMembers(Microsoft.Cci.ITypeDefinition):this
        -157 (-1.45% of base) : 168030.dasm - R2RTest.BuildFolderSet:WriteBuildStatistics(System.IO.StreamWriter):this
        -153 (-5.15% of base) : 83448.dasm - Microsoft.Diagnostics.Tracing.Etlx.TraceLog:FastSerialization.IFastSerializable.FromStream(FastSerialization.Deserializer):this
        -151 (-3.40% of base) : 140423.dasm - System.Xml.Xsl.Xslt.QilGenerator:System.Xml.Xsl.XPath.IXPathEnvironment.ResolveFunction(System.String,System.String,System.Collections.Generic.IList`1[[System.Xml.Xsl.Qil.QilNode, System.Private.Xml, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]],System.Xml.Xsl.XPath.IFocus):System.Xml.Xsl.Qil.QilNode:this
        -150 (-4.17% of base) : 137494.dasm - System.Xml.Schema.Compiler:Compile():bool:this
        -147 (-3.42% of base) : 204412.dasm - System.Net.Mail.MailMessage:SetContent(bool):this
        -144 (-5.08% of base) : 104562.dasm - Newtonsoft.Json.JsonValidatingReader:ValidateCurrentToken():this
        -141 (-0.71% of base) : 201562.dasm - System.Management.ManagementClassGenerator:GenerateMethods():this
        -138 (-2.09% of base) : 168020.dasm - R2RTest.BuildFolderSet:CompileFramework():bool:this
        -138 (-2.48% of base) : 108839.dasm - System.Data.XSDSchema:LoadSchema(System.Xml.Schema.XmlSchemaSet,System.Data.DataSet):this
        -132 (-1.57% of base) : 53500.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser:ParseConditionalCompilationSymbols(System.String,byref,System.Collections.Generic.IEnumerable`1[[System.Collections.Generic.KeyValuePair`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]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]):System.Collections.Generic.IReadOnlyDictionary`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]]

Top method regressions (percentages):
           2 ( 0.39% of base) : 174230.dasm - Node[Vector`1][System.Numerics.Vector`1[System.Single]]:Remove(System.Numerics.Vector`1[Single],System.Collections.Generic.IComparer`1[Vector`1],byref):Node[Vector`1]:this
           1 ( 0.11% of base) : 20823.dasm - CollectionsMarshalHelper[Int32,Nullable`1][System.Int32,System.Nullable`1[System.Int32]]:GetValueRefOrAddDefault(System.Collections.Generic.Dictionary`2[Int32,Nullable`1],int,byref):byref

Top method improvements (percentages):
          -3 (-18.75% of base) : 70301.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsMe(Microsoft.CodeAnalysis.IParameterSymbol):bool
          -3 (-18.75% of base) : 70300.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsMustOverride(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-18.75% of base) : 70299.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsNotOverridable(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-18.75% of base) : 70298.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsOverridable(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-18.75% of base) : 70297.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsOverrides(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-18.75% of base) : 70296.dasm - Microsoft.CodeAnalysis.VisualBasic.VisualBasicExtensions:IsShared(Microsoft.CodeAnalysis.ISymbol):bool
          -3 (-18.75% of base) : 10461.dasm - Microsoft.FSharp.Collections.IEnumerator:dispose(System.IDisposable)
          -3 (-18.75% of base) : 106522.dasm - Newtonsoft.Json.Linq.JToken:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 168440.dasm - System.CodeDom.CodeAttributeArgumentCollection:Add(System.CodeDom.CodeAttributeArgument):int:this
          -3 (-18.75% of base) : 168443.dasm - System.CodeDom.CodeAttributeArgumentCollection:Contains(System.CodeDom.CodeAttributeArgument):bool:this
          -3 (-18.75% of base) : 168444.dasm - System.CodeDom.CodeAttributeArgumentCollection:CopyTo(System.CodeDom.CodeAttributeArgument[],int):this
          -3 (-18.75% of base) : 168445.dasm - System.CodeDom.CodeAttributeArgumentCollection:IndexOf(System.CodeDom.CodeAttributeArgument):int:this
          -3 (-18.75% of base) : 168446.dasm - System.CodeDom.CodeAttributeArgumentCollection:Insert(int,System.CodeDom.CodeAttributeArgument):this
          -3 (-18.75% of base) : 168447.dasm - System.CodeDom.CodeAttributeArgumentCollection:Remove(System.CodeDom.CodeAttributeArgument):this
          -3 (-18.75% of base) : 168439.dasm - System.CodeDom.CodeAttributeArgumentCollection:set_Item(int,System.CodeDom.CodeAttributeArgument):this
          -3 (-18.75% of base) : 169467.dasm - System.Collections.Concurrent.BlockingCollection`1[__Canon][System.__Canon]:CopyTo(System.__Canon[],int):this
          -3 (-18.75% of base) : 169529.dasm - System.Collections.Concurrent.BlockingCollection`1[Byte][System.Byte]:CopyTo(System.Byte[],int):this
          -3 (-18.75% of base) : 169534.dasm - System.Collections.Concurrent.BlockingCollection`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 20474.dasm - System.Collections.Concurrent.ConcurrentQueue`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 180209.dasm - System.ComponentModel.Design.DesignerVerbCollection:Add(System.ComponentModel.Design.DesignerVerb):int:this

17631 total methods with Code Size differences (17629 improved, 2 regressed), 12 unchanged.


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


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 114709931 (overridden on cmd)
Total bytes of diff: 114343851 (overridden on cmd)
Total bytes of delta: -366080 (-0.32 % of base)
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
       -2358 : 24492.dasm (-2.82% of base)
       -2358 : 24507.dasm (-2.88% of base)
        -450 : 24500.dasm (-2.55% of base)
        -432 : 24502.dasm (-2.78% of base)
        -342 : 147588.dasm (-5.99% of base)
        -302 : 134943.dasm (-5.69% of base)
        -270 : 3446.dasm (-5.13% of base)
        -267 : 248899.dasm (-3.67% of base)
        -267 : 249001.dasm (-3.67% of base)
        -267 : 248618.dasm (-3.67% of base)
        -267 : 248685.dasm (-3.67% of base)
        -267 : 249157.dasm (-3.67% of base)
        -234 : 258991.dasm (-3.96% of base)
        -219 : 302144.dasm (-4.07% of base)
        -213 : 237028.dasm (-6.07% of base)
        -198 : 236682.dasm (-6.27% of base)
        -195 : 280736.dasm (-2.71% of base)
        -183 : 157852.dasm (-1.91% of base)
        -180 : 144758.dasm (-2.01% of base)
        -180 : 144713.dasm (-2.01% of base)

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

Top method improvements (bytes):
       -2358 (-2.88% of base) : 24507.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.statements.freach.freach001.freach001.Test:MainMethod():int
       -2358 (-2.82% of base) : 24492.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.statements.freach.freach007.freach007.Test:MainMethod():int
        -450 (-2.55% of base) : 24500.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.statements.freach.freach004.freach004.Test:MainMethod():int
        -432 (-2.78% of base) : 24502.dasm - ManagedTests.DynamicCSharp.Conformance.dynamic.statements.freach.freach003.freach003.Test:MainMethod():int
        -342 (-5.99% of base) : 147588.dasm - System.ComponentModel.Composition.CompositionServicesTests:GetDefaultContractNameTest():this
        -302 (-5.69% of base) : 134943.dasm - <EnumerateMemoryRegions>d__62:MoveNext():bool:this
        -270 (-5.13% of base) : 3446.dasm - Microsoft.CodeAnalysis.Workspace:ApplyProjectChanges(Microsoft.CodeAnalysis.ProjectChanges):this
        -267 (-3.67% of base) : 248899.dasm - Microsoft.Extensions.Configuration.Test.ConfigurationProviderTestBase:AssertConfig(Microsoft.Extensions.Configuration.IConfigurationRoot,bool,System.String):this
        -267 (-3.67% of base) : 249001.dasm - Microsoft.Extensions.Configuration.Test.ConfigurationProviderTestBase:AssertConfig(Microsoft.Extensions.Configuration.IConfigurationRoot,bool,System.String):this
        -267 (-3.67% of base) : 248618.dasm - Microsoft.Extensions.Configuration.Test.ConfigurationProviderTestBase:AssertConfig(Microsoft.Extensions.Configuration.IConfigurationRoot,bool,System.String):this
        -267 (-3.67% of base) : 248685.dasm - Microsoft.Extensions.Configuration.Test.ConfigurationProviderTestBase:AssertConfig(Microsoft.Extensions.Configuration.IConfigurationRoot,bool,System.String):this
        -267 (-3.67% of base) : 249157.dasm - Microsoft.Extensions.Configuration.Test.ConfigurationProviderTestBase:AssertConfig(Microsoft.Extensions.Configuration.IConfigurationRoot,bool,System.String):this
        -234 (-3.96% of base) : 258991.dasm - NuGet.ProjectModel.LockFileTargetLibrary:GetHashCode():int:this
        -219 (-4.07% of base) : 302144.dasm - System.Net.NetworkInformation.Tests.IPInterfacePropertiesTest_Windows:<IPInfoTest_AccessAllProperties_NoErrors>b__2_0():this
        -213 (-6.07% of base) : 237028.dasm - Grace.DependencyInjection.Impl.Expressions.ActivationExpressionBuilder:GetValueFromRequest(Grace.DependencyInjection.IInjectionScope,Grace.DependencyInjection.IActivationExpressionRequest,System.Type,System.Object):Grace.DependencyInjection.IActivationExpressionResult:this
        -198 (-6.27% of base) : 236682.dasm - Grace.DependencyInjection.Impl.InjectionScope:Configure(System.Action`1[[Grace.DependencyInjection.IExportRegistrationBlock, Grace, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b7d24c6367970497]]):this
        -195 (-2.71% of base) : 280736.dasm - System.Diagnostics.Tests.ProcessStartInfoTests:TestEnvironmentProperty():this
        -183 (-1.91% of base) : 157852.dasm - BasicEventSourceTests.TestsWriteEventToListener:Test_WriteEvent_ArgsBasicTypes():this
        -180 (-2.01% of base) : 144758.dasm - System.CodeDom.Compiler.Tests.CSharpCodeGenerationTests:RegionsSnippetsAndLinePragmas():this
        -180 (-2.01% of base) : 144713.dasm - System.CodeDom.Compiler.Tests.VBCodeGenerationTests:RegionsSnippetsAndLinePragmas():this

Top method improvements (percentages):
         -10 (-29.41% of base) : 350736.dasm - CXmlCache:DebugTrace(System.String):this
          -3 (-18.75% of base) : 228419.dasm - Castle.Components.DictionaryAdapter.ListProjection`1[__Canon][System.__Canon]:Replace(System.Collections.Generic.IEnumerable`1[__Canon]):this
          -3 (-18.75% of base) : 228469.dasm - Castle.Components.DictionaryAdapter.ListProjection`1[Byte][System.Byte]:Replace(System.Collections.Generic.IEnumerable`1[Byte]):this
          -3 (-18.75% of base) : 232147.dasm - DryIoc.Resolver:Resolve(DryIoc.IResolver,System.Type,int):System.Object
          -3 (-18.75% of base) : 234493.dasm - FluentAssertions.Equivalency.EquivalencyAssertionOptionsExtentions:ShouldUseRuntimeType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions):bool
          -3 (-18.75% of base) : 198142.dasm - ImplementDictionary:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 349246.dasm - ImplementDictionary:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 325945.dasm - ImplementDictionary:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 67142.dasm - ImplementDictionary:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 348266.dasm - ImplementDictionary:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 327107.dasm - ImplementDictionary:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 240097.dasm - LamarCompiler.Util.LightweightCache`2[__Canon,Nullable`1][System.__Canon,System.Nullable`1[System.Int32]]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 240122.dasm - LamarCompiler.Util.LightweightCache`2[Byte,Nullable`1][System.Byte,System.Nullable`1[System.Int32]]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 242110.dasm - LightInject.ServiceRegistryExtensions:RegisterTransient(LightInject.IServiceRegistry,System.Type):LightInject.IServiceRegistry
          -3 (-18.75% of base) : 242158.dasm - LightInject.ServiceRegistryExtensions:RegisterTransient(LightInject.IServiceRegistry,System.Type,System.Type):LightInject.IServiceRegistry
          -3 (-18.75% of base) : 242111.dasm - LightInject.ServiceRegistryExtensions:RegisterTransient(LightInject.IServiceRegistry,System.Type,System.Type,System.String):LightInject.IServiceRegistry
          -3 (-18.75% of base) : 122558.dasm - Microsoft.Build.Collections.CopyOnReadEnumerable`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 122607.dasm - Microsoft.Build.Collections.CopyOnWriteDictionary`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 114518.dasm - Microsoft.Build.Collections.CopyOnWriteDictionary`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
          -3 (-18.75% of base) : 244049.dasm - Microsoft.Build.Collections.CopyOnWriteDictionary`1[Byte][System.Byte]:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this

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


@BruceForstall
Copy link
Member

Can you show some sample diffs?

@jakobbotsch
Copy link
Member Author

jakobbotsch commented Oct 8, 2021

Can you show some sample diffs?

The regressions are due to alignment changes. Otherwise the diffs all look like this:

@@ -165,7 +165,7 @@ G_M44684_IG03:        ; , extend
        ; byrRegs -[rcx]
        lea      r11, [(reloc)]
        cmp      dword ptr [rcx], ecx
-       call     [hackishModuleName:hackishMethodName()]
+       call     gword ptr [r11]hackishModuleName:hackishMethodName()
        ; gcrRegs -[rcx rdx rsi] +[rax]
        ; byrRegs -[rdi]
        ; gcr arg pop 0
@@ -201,7 +201,7 @@ G_M44684_IG04:        ; , epilog, nogc, extend
        ret
@@ -22,11 +22,10 @@ G_M51262_IG02:        ; gcrefRegs=00000006 {rcx rdx}, byrefRegs=00000000 {}, byr
        cmp      dword ptr [rcx], ecx
                                                ;; bbWeight=1    PerfScore 5.50
 G_M51262_IG03:        ; , epilog, nogc, extend
-       tail.jmp [hackishModuleName:hackishMethodName()]
-       ; gcr arg pop 0
+       tail.jmp qword ptr [r11]hackishModuleName:hackishMethodName()

@BruceForstall
Copy link
Member

In call gword ptr [r11]hackishModuleName:hackishMethodName(), the gword seems to indicate that r11 is a gcref? Is that correct?

@jakobbotsch
Copy link
Member Author

In call gword ptr [r11]hackishModuleName:hackishMethodName(), the gword seems to indicate that r11 is a gcref? Is that correct?

Looks like we use that bit to indicate the GC-ness of the return value for calls:

// If the method returns a GC ref, mark EAX appropriately
if (id->idGCref() == GCT_GCREF)
{
gcrefRegs |= RBM_EAX;
}
else if (id->idGCref() == GCT_BYREF)
{
byrefRegs |= RBM_EAX;
}

So it is the disassembly that's confusing, we always print it before the addressing mode for IF_ARD format. I pushed a commit that suppresses printing the annotation for calls.

@jakobbotsch jakobbotsch merged commit 8076775 into dotnet:main Oct 15, 2021
@jakobbotsch jakobbotsch deleted the optimize-vsd-sequences branch October 15, 2021 08:02
@kunalspathak
Copy link
Member

Improvements on ubuntu/x64 - dotnet/perf-autofiling-issues#1898

@ghost ghost locked as resolved and limited conversation to collaborators Nov 18, 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