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: fix invocation of unboxed entry when method returns struct #52998

Merged
merged 2 commits into from
May 20, 2021

Conversation

AndyAyersMS
Copy link
Member

If a value class method returns a struct, and its unboxed entry point
requires a type context argument, make sure to pass the context argument
properly.

Also, fetch the type context (method table) from the box, rather than
creating it from the class handle we have on hand; this tends to produce
smaller code as we're often fetching the method table for other reasons
anyways.

Closes #52975.

If a value class method returns a struct, and its unboxed entry point
requires a type context argument, make sure to pass the context argument
properly.

Also, fetch the type context (method table) from the box, rather than
creating it from the class handle we have on hand; this tends to produce
smaller code as we're often fetching the method table for other reasons
anyways.

Closes dotnet#52975.
@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 May 19, 2021
@AndyAyersMS
Copy link
Member Author

cc @dotnet/jit-contrib

There are likely diffs in asp.net too, but I need to update the collection first.

asm.libraries.pmi.windows.x64.checked


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 74961
Total bytes of diff: 73267
Total bytes of delta: -1694 (-2.26% of base)
    diff is an improvement.

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

Detail diffs


Top file improvements (bytes):
        -117 : 129261.dasm (-8.66% of base)
        -117 : 129262.dasm (-8.66% of base)
         -68 : 164998.dasm (-7.71% of base)
         -68 : 166359.dasm (-7.71% of base)
         -56 : 129849.dasm (-3.75% of base)
         -51 : 129836.dasm (-3.41% of base)
         -45 : 106543.dasm (-8.77% of base)
         -41 : 106545.dasm (-4.04% of base)
         -41 : 107579.dasm (-7.72% of base)
         -38 : 106515.dasm (-4.21% of base)
         -34 : 167527.dasm (-3.81% of base)
         -34 : 107749.dasm (-5.79% of base)
         -33 : 129689.dasm (-4.31% of base)
         -33 : 165745.dasm (-3.20% of base)
         -31 : 161228.dasm (-1.97% of base)
         -29 : 126648.dasm (-6.16% of base)
         -29 : 129700.dasm (-4.49% of base)
         -29 : 166366.dasm (-2.31% of base)
         -29 : 108669.dasm (-4.52% of base)
         -29 : 110866.dasm (-4.60% of base)

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

Top method improvements (bytes):
        -117 (-8.66% of base) : 129261.dasm - System.Xml.Xsl.Qil.QilScopedVisitor:BeforeVisit(System.Xml.Xsl.Qil.QilNode):this
        -117 (-8.66% of base) : 129262.dasm - System.Xml.Xsl.Qil.QilScopedVisitor:AfterVisit(System.Xml.Xsl.Qil.QilNode):this
         -68 (-7.71% of base) : 164998.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -68 (-7.71% of base) : 166359.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -56 (-3.75% of base) : 129849.dasm - System.Xml.Xsl.IlGen.XmlILVisitor:Function(System.Xml.Xsl.Qil.QilFunction):this
         -51 (-3.41% of base) : 129836.dasm - System.Xml.Xsl.IlGen.XmlILVisitor:VisitStrConcat(System.Xml.Xsl.Qil.QilStrConcat):System.Xml.Xsl.Qil.QilNode:this
         -45 (-8.77% of base) : 106543.dasm - System.Data.DataColumn:CheckMaxLength():bool:this
         -41 (-4.04% of base) : 106545.dasm - System.Data.DataColumn:CheckNotAllowNull():this
         -41 (-7.72% of base) : 107579.dasm - System.Data.DataTable:EvaluateExpressions():this
         -38 (-4.21% of base) : 106515.dasm - System.Data.DataColumn:IsMaxLengthViolated():bool:this
         -34 (-3.81% of base) : 167527.dasm - OleDbProviderConverter:GetStandardValues(System.ComponentModel.ITypeDescriptorContext):StandardValuesCollection:this
         -34 (-5.79% of base) : 107749.dasm - System.Data.DataTable:Copy():System.Data.DataTable:this
         -33 (-4.31% of base) : 129689.dasm - System.Xml.Xsl.IlGen.XmlILOptimizerVisitor:VisitQilExpression(System.Xml.Xsl.Qil.QilExpression):System.Xml.Xsl.Qil.QilNode:this
         -33 (-3.20% of base) : 165745.dasm - System.Data.Odbc.OdbcMetaDataFactory:NewDataTableFromReader(System.Data.IDataReader,byref,System.String):System.Data.DataTable:this
         -31 (-1.97% of base) : 161228.dasm - System.ComponentModel.ComponentResourceManager:ApplyResources(System.Object,System.String,System.Globalization.CultureInfo):this
         -29 (-6.16% of base) : 126648.dasm - System.Xml.Xsl.Xslt.QilGenerator:CompileTextAvt(System.String):System.Xml.Xsl.Qil.QilNode:this
         -29 (-4.49% of base) : 129700.dasm - System.Xml.Xsl.IlGen.XmlILOptimizerVisitor:VisitSequence(System.Xml.Xsl.Qil.QilList):System.Xml.Xsl.Qil.QilNode:this
         -29 (-2.31% of base) : 166366.dasm - System.Data.ProviderBase.DbMetaDataFactory:GetParameterName(System.String,int):System.String:this
         -29 (-4.52% of base) : 108669.dasm - System.Data.Index:InitRecords(System.Data.IFilter):this
         -29 (-4.60% of base) : 110866.dasm - System.Data.Common.DbDataReaderExtensions:GetColumnSchemaCompatibility(System.Data.Common.DbDataReader):System.Collections.ObjectModel.ReadOnlyCollection`1[[System.Data.Common.DbColumn, System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]

Top method improvements (percentages):
         -29 (-11.51% of base) : 129324.dasm - System.Xml.Xsl.Qil.QilTypeChecker:CheckFunctionList(System.Xml.Xsl.Qil.QilList):System.Xml.Xsl.XmlQueryType:this
         -25 (-9.16% of base) : 129608.dasm - System.Xml.Xsl.IlGen.XmlILOptimizerVisitor:HasNestedSequence(System.Xml.Xsl.Qil.QilNode):bool:this
         -25 (-8.96% of base) : 129645.dasm - System.Xml.Xsl.IlGen.XmlILOptimizerVisitor:AreLiteralArgs(System.Xml.Xsl.Qil.QilNode):bool:this
         -45 (-8.77% of base) : 106543.dasm - System.Data.DataColumn:CheckMaxLength():bool:this
         -29 (-8.73% of base) : 129527.dasm - System.Xml.Xsl.IlGen.TailCallAnalyzer:Analyze(System.Xml.Xsl.Qil.QilExpression)
        -117 (-8.66% of base) : 129261.dasm - System.Xml.Xsl.Qil.QilScopedVisitor:BeforeVisit(System.Xml.Xsl.Qil.QilNode):this
        -117 (-8.66% of base) : 129262.dasm - System.Xml.Xsl.Qil.QilScopedVisitor:AfterVisit(System.Xml.Xsl.Qil.QilNode):this
         -41 (-7.72% of base) : 107579.dasm - System.Data.DataTable:EvaluateExpressions():this
         -68 (-7.71% of base) : 164998.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -68 (-7.71% of base) : 166359.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -29 (-6.16% of base) : 126648.dasm - System.Xml.Xsl.Xslt.QilGenerator:CompileTextAvt(System.String):System.Xml.Xsl.Qil.QilNode:this
         -34 (-5.79% of base) : 107749.dasm - System.Data.DataTable:Copy():System.Data.DataTable:this
         -23 (-5.64% of base) : 129875.dasm - System.Xml.Xsl.IlGen.XmlILVisitor:VisitSequence(System.Xml.Xsl.Qil.QilList):System.Xml.Xsl.Qil.QilNode:this
         -25 (-4.93% of base) : 129847.dasm - System.Xml.Xsl.IlGen.XmlILVisitor:PrepareGlobalValues(System.Xml.Xsl.Qil.QilList):this
         -29 (-4.60% of base) : 110866.dasm - System.Data.Common.DbDataReaderExtensions:GetColumnSchemaCompatibility(System.Data.Common.DbDataReader):System.Collections.ObjectModel.ReadOnlyCollection`1[[System.Data.Common.DbColumn, System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]
         -29 (-4.52% of base) : 108669.dasm - System.Data.Index:InitRecords(System.Data.IFilter):this
         -29 (-4.49% of base) : 129700.dasm - System.Xml.Xsl.IlGen.XmlILOptimizerVisitor:VisitSequence(System.Xml.Xsl.Qil.QilList):System.Xml.Xsl.Qil.QilNode:this
         -29 (-4.48% of base) : 129846.dasm - System.Xml.Xsl.IlGen.XmlILVisitor:Visit(System.Xml.Xsl.Qil.QilExpression,System.Xml.Xsl.IlGen.GenerateHelper,System.Reflection.MethodInfo):this
         -33 (-4.31% of base) : 129689.dasm - System.Xml.Xsl.IlGen.XmlILOptimizerVisitor:VisitQilExpression(System.Xml.Xsl.Qil.QilExpression):System.Xml.Xsl.Qil.QilNode:this
         -38 (-4.21% of base) : 106515.dasm - System.Data.DataColumn:IsMaxLengthViolated():bool:this




asm.tests_libraries.pmi.windows.x64.checked


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 68582
Total bytes of diff: 67398
Total bytes of delta: -1184 (-1.73% of base)
    diff is an improvement.

37 total methods with Code Size differences (34 improved, 3 regressed), 0 unchanged.
Detail diffs


Top file regressions (bytes):
          10 : 238791.dasm (0.52% of base)
          10 : 242993.dasm (0.52% of base)
           1 : 105819.dasm (0.13% of base)

Top file improvements (bytes):
        -284 : 159591.dasm (-1.69% of base)
         -76 : 158796.dasm (-4.15% of base)
         -68 : 240055.dasm (-7.71% of base)
         -68 : 244405.dasm (-7.71% of base)
         -42 : 239137.dasm (-3.68% of base)
         -42 : 243331.dasm (-3.68% of base)
         -41 : 279092.dasm (-7.62% of base)
         -41 : 159662.dasm (-2.73% of base)
         -37 : 159692.dasm (-2.39% of base)
         -34 : 158895.dasm (-5.81% of base)
         -34 : 159595.dasm (-3.88% of base)
         -34 : 159812.dasm (-5.41% of base)
         -30 : 242772.dasm (-2.68% of base)
         -30 : 158797.dasm (-1.23% of base)
         -30 : 159568.dasm (-0.75% of base)
         -30 : 247182.dasm (-2.68% of base)
         -29 : 240062.dasm (-2.53% of base)
         -29 : 244412.dasm (-2.53% of base)
         -27 : 118508.dasm (-0.89% of base)
         -25 : 158925.dasm (-4.60% of base)

37 total files with Code Size differences (34 improved, 3 regressed), 0 unchanged.

Top method regressions (bytes):
          10 ( 0.52% of base) : 238791.dasm - Microsoft.SqlServer.Server.MetaDataUtilsSmi:SmiMetaDataFromDataColumn(System.Data.DataColumn,System.Data.DataTable):Microsoft.SqlServer.Server.SmiExtendedMetaData
          10 ( 0.52% of base) : 242993.dasm - Microsoft.SqlServer.Server.MetaDataUtilsSmi:SmiMetaDataFromDataColumn(System.Data.DataColumn,System.Data.DataTable):Microsoft.SqlServer.Server.SmiExtendedMetaData
           1 ( 0.13% of base) : 105819.dasm - DryIoc.ServiceDetails:ToString():System.String:this

Top method improvements (bytes):
        -284 (-1.69% of base) : 159591.dasm - System.Data.Tests.DataTableTest2:Select_ByFilter():this
         -76 (-4.15% of base) : 158796.dasm - System.Data.Tests.DataColumnTest2:Expression_Aggregate():this
         -68 (-7.71% of base) : 240055.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -68 (-7.71% of base) : 244405.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -42 (-3.68% of base) : 239137.dasm - Microsoft.SqlServer.Server.ValueUtilsSmi:SetDataTable_Unchecked(Microsoft.SqlServer.Server.SmiEventSink_Default,Microsoft.SqlServer.Server.SmiTypedGetterSetter,int,Microsoft.SqlServer.Server.SmiMetaData,System.Data.DataTable)
         -42 (-3.68% of base) : 243331.dasm - Microsoft.SqlServer.Server.ValueUtilsSmi:SetDataTable_Unchecked(Microsoft.SqlServer.Server.SmiEventSink_Default,Microsoft.SqlServer.Server.SmiTypedGetterSetter,int,Microsoft.SqlServer.Server.SmiMetaData,System.Data.DataTable)
         -41 (-7.62% of base) : 279092.dasm - System.Data.OleDb.Tests.OleDbConnectionTests:GetOleDbSchemaTable_NoRestrictions_Success(System.Guid):this
         -41 (-2.73% of base) : 159662.dasm - System.Data.Tests.DataTableTest4:XmlTest28():this
         -37 (-2.39% of base) : 159692.dasm - System.Data.Tests.DataTableTest4:XmlTest14():this
         -34 (-5.81% of base) : 158895.dasm - System.Data.Tests.DataRowCollectionTest2:CopyTo():this
         -34 (-3.88% of base) : 159595.dasm - System.Data.Tests.DataTableTest2:GetResultRows(System.Data.DataTable,int):System.Data.DataRow[]:this
         -34 (-5.41% of base) : 159812.dasm - System.Data.Tests.DataViewTest2:GetResultRows(System.Data.DataTable,int):System.Data.DataRow[]:this
         -30 (-2.68% of base) : 242772.dasm - SqlInitialCatalogConverter:GetStandardValues(System.ComponentModel.ITypeDescriptorContext):StandardValuesCollection:this
         -30 (-1.23% of base) : 158797.dasm - System.Data.Tests.DataColumnTest2:Expression_AggregateRelation():this
         -30 (-0.75% of base) : 159568.dasm - System.Data.Tests.DataTableTest2:Select_StringString():this
         -30 (-2.68% of base) : 247182.dasm - SqlInitialCatalogConverter:GetStandardValues(System.ComponentModel.ITypeDescriptorContext):StandardValuesCollection:this
         -29 (-2.53% of base) : 240062.dasm - System.Data.ProviderBase.DbMetaDataFactory:GetParameterName(System.String,int):System.String:this
         -29 (-2.53% of base) : 244412.dasm - System.Data.ProviderBase.DbMetaDataFactory:GetParameterName(System.String,int):System.String:this
         -27 (-0.89% of base) : 118508.dasm - Microsoft.Build.Tasks.StronglyTypedResourceBuilder:InternalCreate(System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.Build.Tasks.StronglyTypedResourceBuilder+ResourceData, Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]],System.String,System.String,System.String,System.CodeDom.Compiler.CodeDomProvider,bool,byref):System.CodeDom.CodeCompileUnit
         -25 (-4.60% of base) : 158925.dasm - System.Data.Tests.DataRowCollectionTest2:DataRowCollection_Item1():this

Top method regressions (percentages):
          10 ( 0.52% of base) : 238791.dasm - Microsoft.SqlServer.Server.MetaDataUtilsSmi:SmiMetaDataFromDataColumn(System.Data.DataColumn,System.Data.DataTable):Microsoft.SqlServer.Server.SmiExtendedMetaData
          10 ( 0.52% of base) : 242993.dasm - Microsoft.SqlServer.Server.MetaDataUtilsSmi:SmiMetaDataFromDataColumn(System.Data.DataColumn,System.Data.DataTable):Microsoft.SqlServer.Server.SmiExtendedMetaData
           1 ( 0.13% of base) : 105819.dasm - DryIoc.ServiceDetails:ToString():System.String:this

Top method improvements (percentages):
         -68 (-7.71% of base) : 240055.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -68 (-7.71% of base) : 244405.dasm - System.Data.ProviderBase.DbMetaDataFactory:CloneAndFilterCollection(System.String,System.String[]):System.Data.DataTable:this
         -41 (-7.62% of base) : 279092.dasm - System.Data.OleDb.Tests.OleDbConnectionTests:GetOleDbSchemaTable_NoRestrictions_Success(System.Guid):this
         -34 (-5.81% of base) : 158895.dasm - System.Data.Tests.DataRowCollectionTest2:CopyTo():this
         -34 (-5.41% of base) : 159812.dasm - System.Data.Tests.DataViewTest2:GetResultRows(System.Data.DataTable,int):System.Data.DataRow[]:this
         -25 (-4.60% of base) : 158925.dasm - System.Data.Tests.DataRowCollectionTest2:DataRowCollection_Item1():this
         -76 (-4.15% of base) : 158796.dasm - System.Data.Tests.DataColumnTest2:Expression_Aggregate():this
         -34 (-3.88% of base) : 159595.dasm - System.Data.Tests.DataTableTest2:GetResultRows(System.Data.DataTable,int):System.Data.DataRow[]:this
         -42 (-3.68% of base) : 239137.dasm - Microsoft.SqlServer.Server.ValueUtilsSmi:SetDataTable_Unchecked(Microsoft.SqlServer.Server.SmiEventSink_Default,Microsoft.SqlServer.Server.SmiTypedGetterSetter,int,Microsoft.SqlServer.Server.SmiMetaData,System.Data.DataTable)
         -42 (-3.68% of base) : 243331.dasm - Microsoft.SqlServer.Server.ValueUtilsSmi:SetDataTable_Unchecked(Microsoft.SqlServer.Server.SmiEventSink_Default,Microsoft.SqlServer.Server.SmiTypedGetterSetter,int,Microsoft.SqlServer.Server.SmiMetaData,System.Data.DataTable)
         -41 (-2.73% of base) : 159662.dasm - System.Data.Tests.DataTableTest4:XmlTest28():this
         -30 (-2.68% of base) : 242772.dasm - SqlInitialCatalogConverter:GetStandardValues(System.ComponentModel.ITypeDescriptorContext):StandardValuesCollection:this
         -30 (-2.68% of base) : 247182.dasm - SqlInitialCatalogConverter:GetStandardValues(System.ComponentModel.ITypeDescriptorContext):StandardValuesCollection:this
         -29 (-2.53% of base) : 240062.dasm - System.Data.ProviderBase.DbMetaDataFactory:GetParameterName(System.String,int):System.String:this
         -29 (-2.53% of base) : 244412.dasm - System.Data.ProviderBase.DbMetaDataFactory:GetParameterName(System.String,int):System.String:this
          -6 (-2.41% of base) : 24224.dasm - System.Collections.Tests.Dictionary_IDictionary_NonGeneric_Tests:Clear_OnEmptyCollection_DoesNotInvalidateEnumerator():this
         -37 (-2.39% of base) : 159692.dasm - System.Data.Tests.DataTableTest4:XmlTest14():this
         -20 (-1.79% of base) : 240060.dasm - System.Data.ProviderBase.DbMetaDataFactory:FindMetaDataCollectionRow(System.String):System.Data.DataRow:this
         -20 (-1.79% of base) : 244410.dasm - System.Data.ProviderBase.DbMetaDataFactory:FindMetaDataCollectionRow(System.String):System.Data.DataRow:this
         -25 (-1.76% of base) : 158974.dasm - System.Data.Tests.DataRowTest2:IsNull_ByName():this




@AndyAyersMS
Copy link
Member Author

ASP.NET diffs

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 10609
Total bytes of diff: 10527
Total bytes of delta: -82 (-0.77% of base)
    diff is an improvement.


Top file regressions (bytes):
           4 : 29680.dasm (1.29% of base)

Top file improvements (bytes):
         -14 : 40069.dasm (-5.05% of base)
         -11 : 16218.dasm (-0.60% of base)
         -11 : 14269.dasm (-0.53% of base)
          -7 : 39665.dasm (-2.24% of base)
          -7 : 37144.dasm (-1.12% of base)
          -7 : 42028.dasm (-0.56% of base)
          -7 : 39875.dasm (-2.79% of base)
          -7 : 39944.dasm (-1.88% of base)
          -7 : 40022.dasm (-2.05% of base)
          -7 : 40032.dasm (-7.29% of base)
          -1 : 37455.dasm (-0.07% of base)

12 total files with Code Size differences (11 improved, 1 regressed), 1 unchanged.

Top method regressions (bytes):
           4 ( 1.29% of base) : 29680.dasm - Enumerable:Any(IEnumerable`1,Func`2):bool

Top method improvements (bytes):
         -14 (-5.05% of base) : 40069.dasm - WhereEnumerableIterator`1:MoveNext():bool:this
         -11 (-0.60% of base) : 16218.dasm - <TransformRequestAsync>d__19:MoveNext():this
         -11 (-0.53% of base) : 14269.dasm - <TransformRequestAsync>d__19:MoveNext():this
          -7 (-2.24% of base) : 39665.dasm - Enumerable:Any(IEnumerable`1,Func`2):bool
          -7 (-1.12% of base) : 37144.dasm - <<ExecuteAsync>b__8_1>d:MoveNext():this
          -7 (-0.56% of base) : 42028.dasm - <<ExecuteAsync>b__8_1>d:MoveNext():this
          -7 (-2.79% of base) : 39875.dasm - SelectIListIterator`2:MoveNext():bool:this
          -7 (-1.88% of base) : 39944.dasm - <CastIterator>d__63`1:MoveNext():bool:this
          -7 (-2.05% of base) : 40022.dasm - SelectManySingleSelectorIterator`2:MoveNext():bool:this
          -7 (-7.29% of base) : 40032.dasm - WhereEnumerableIterator`1:Dispose():this
          -1 (-0.07% of base) : 37455.dasm - MiddlewareHelpers:RenderFortunesHtml(IEnumerable`1,HttpContext,HtmlEncoder):Task

Top method regressions (percentages):
           4 ( 1.29% of base) : 29680.dasm - Enumerable:Any(IEnumerable`1,Func`2):bool

Top method improvements (percentages):
          -7 (-7.29% of base) : 40032.dasm - WhereEnumerableIterator`1:Dispose():this
         -14 (-5.05% of base) : 40069.dasm - WhereEnumerableIterator`1:MoveNext():bool:this
          -7 (-2.79% of base) : 39875.dasm - SelectIListIterator`2:MoveNext():bool:this
          -7 (-2.24% of base) : 39665.dasm - Enumerable:Any(IEnumerable`1,Func`2):bool
          -7 (-2.05% of base) : 40022.dasm - SelectManySingleSelectorIterator`2:MoveNext():bool:this
          -7 (-1.88% of base) : 39944.dasm - <CastIterator>d__63`1:MoveNext():bool:this
          -7 (-1.12% of base) : 37144.dasm - <<ExecuteAsync>b__8_1>d:MoveNext():this
         -11 (-0.60% of base) : 16218.dasm - <TransformRequestAsync>d__19:MoveNext():this
          -7 (-0.56% of base) : 42028.dasm - <<ExecuteAsync>b__8_1>d:MoveNext():this
         -11 (-0.53% of base) : 14269.dasm - <TransformRequestAsync>d__19:MoveNext():this
          -1 (-0.07% of base) : 37455.dasm - MiddlewareHelpers:RenderFortunesHtml(IEnumerable`1,HttpContext,HtmlEncoder):Task

12 total methods with Code Size differences (11 improved, 1 regressed), 1 unchanged.

@AndyAyersMS
Copy link
Member Author

Kicked off the experimental CI group to do some PGO testing. That has a few known failures in OSR, so will have to look at the results closely.

Copy link
Contributor

@sandreenko sandreenko left a comment

Choose a reason for hiding this comment

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

LGTM, a few questions

@@ -21115,7 +21115,17 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call,
//
if ((Target::g_tgtArgOrder == Target::ARG_ORDER_R2L) || (call->gtCallArgs == nullptr))
{
call->gtCallArgs = gtPrependNewCallArg(methodTableArg, call->gtCallArgs);
// If there's a ret buf, the context is the second arg.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
// If there's a ret buf, the context is the second arg.
// If there's a ret buf, the method table is the second arg.

if (call->HasRetBufArg())
{
GenTreeCall::Use* const beforeArg = call->gtCallArgs;
beforeArg->SetNext(gtNewCallArgs(methodTableArg));
Copy link
Contributor

Choose a reason for hiding this comment

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

would gtInsertNewCallArgAfter(methodTableArg, call->gtCallArgs) work here? If I understand correctly 'gtCallArgspoints toretBufArgand we need to insertmethodTableArg` after it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that would work. You prefer it that way?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it would be similar to 'else' then I think.

@@ -21194,26 +21204,26 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call,
// locally, or was boxed locally but we were unable to remove the box for
// various reasons.
//
// We may still be able to update the call to invoke the unboxed entry.
// We can still to update the call to invoke the unboxed entry, if the
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
// We can still to update the call to invoke the unboxed entry, if the
// We can still update the call to invoke the unboxed entry, if the

//
// Prepend for R2L arg passing or empty L2R passing
// Append for non-empty L2R
//
if ((Target::g_tgtArgOrder == Target::ARG_ORDER_R2L) || (call->gtCallArgs == nullptr))
{
call->gtCallArgs = gtPrependNewCallArg(methodTableArg, call->gtCallArgs);
// If there's a ret buf, the context is the second arg.
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

if (call->HasRetBufArg())
{
GenTreeCall::Use* const beforeArg = call->gtCallArgs;
beforeArg->SetNext(gtNewCallArgs(methodTableArg));
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@AndyAyersMS
Copy link
Member Author

Experimental failures were the two expected OSR failures (case 2 in #43534) plus a bunch of instances of #52988.

@AndyAyersMS
Copy link
Member Author

Linux arm release libraries: tests succeeded by failed to properly upload status:

azure.devops.exceptions.AzureDevOpsClientRequestError: Operation returned an invalid status code of 503.

OSX failure is another instance of #52710.

@AndyAyersMS AndyAyersMS merged commit e0eda5f into dotnet:main May 20, 2021
@AndyAyersMS AndyAyersMS deleted the Fix52975 branch May 20, 2021 18:56
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 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.

Test case failure with TieredPGO
2 participants