Skip to content

Conversation

@CarolEidt
Copy link
Contributor

No description provided.

@CarolEidt
Copy link
Contributor Author

@dotnet/jit-contrib PTAL

Copy link
Contributor

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM. Any diffs?

@CarolEidt
Copy link
Contributor Author

Here are the diffs for Arm64 and x64/ux:

Arch OS What Delta Methods Improved Methods Regressed
Arm64 Windows Crossgen fx+benchmarks -48672 (-0.04%) 2785 1126
x64 Linux Crossgen fx+benchmarks -80288 (-0.08%) 3342 739
Arm64 Windows PMI fx+benchmarks -77788 (-0.13%) 4667 1140
x64 Linux PMI fx+benchmarks -109433 (-0.21%) 5347 1101

I've sampled some of the regressions, and here are the 3 sources of regressions I've seen (all of the examples below occur on both Arm64 and x64/ux):

  • Tail calls are rejected if there is a promoted struct parameter

    • SPC.dll System.Decimal:Parse(System.ReadOnlySpan`1[Char],int,System.IFormatProvider):System.Decimal (method hash 0xd422ae6c)
    • SPC.dll System.MemoryExtensions:Trim(System.ReadOnlySpan1[Char],System.ReadOnlySpan1[Char]):System.ReadOnlySpan`1[Char] (method hash 0xff09f8a4)
  • Worse codegen for a block copy from a promoted struct to a field of an object. Although the address is put into a local variable, we lose the ability to reuse the value after it's incremented by the helper. Also, we use CORINFO_HELP_CHECKED_ASSIGN_REF instead of CORINFO_HELP_ASSIGN_BYREF. This happens on both Arm64 and x64/ux:

    • xunit.console.dll <>c:b__6_0(System.Collections.Generic.KeyValuePair`2[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]):System.Action``1[[System.Xml.Linq.XElement, System.Private.Xml.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]]:this (method hash 0xff355c80)
  • Plus a few instances where the code gets larger because clone a loop.

@CarolEidt CarolEidt requested a review from sandreenko December 1, 2020 17:21
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

if ((structPromotionInfo.fieldCnt != 2) &&
!((structPromotionInfo.fieldCnt == 1) && varTypeIsSIMD(structPromotionInfo.fields[0].fldType)))
{
JITDUMP("Not promoting multireg struct local V%02u, because lvIsParam is true and #fields != 2\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
JITDUMP("Not promoting multireg struct local V%02u, because lvIsParam is true and #fields != 2\n",
JITDUMP("Not promoting multireg struct local V%02u, because lvIsParam is true and #fields != 2 and not a single SIMD?\n",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - with a minor rewording

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants