Skip to content

2 small CQ optimizations. - #37967

Merged
sandreenko merged 2 commits into
dotnet:masterfrom
sandreenko:generalStructOpt
Jun 16, 2020
Merged

2 small CQ optimizations.#37967
sandreenko merged 2 commits into
dotnet:masterfrom
sandreenko:generalStructOpt

Conversation

@sandreenko

@sandreenkosandreenko commented Jun 16, 2020

Copy link
Copy Markdown
Contributor

Found during JitDoOldStructRetyping work.

Diffs are positive:

Crossgen CodeSize Diffs for System.Private.CoreLib.dll, framework assemblies for default jit
Summary of Code Size diffs:
(Lower is better)
Total bytes of diff: -31060 (-0.10% of base)
3169 total methods with Code Size differences (3167 improved, 2 regressed)
PMI CodeSize Diffs for System.Private.CoreLib.dll, framework assemblies for default jit
Summary of Code Size diffs:
(Lower is better)
Total bytes of diff: -40121 (-0.08% of base)
4964 total methods with Code Size differences (4952 improved, 12 regressed)

Need these changes to get rid of some regressions with !JitDoOldStructRetyping.

A simple diff example, -38 (-35.85% of base) : System.Private.CoreLib.dasm - Math:Truncate(Decimal):Decimal:
before

IN0001: 000008 mov ecx, dword ptr [rdx]
IN0002: 00000A mov dword ptr [V05 rsp+20H], ecx
IN0003: 00000E mov ecx, dword ptr [rdx+4]
IN0004: 000011 mov dword ptr [V06 rsp+24H], ecx
IN0005: 000015 mov ecx, dword ptr [rdx+8]
IN0006: 000018 mov dword ptr [V07 rsp+28H], ecx
IN0007: 00001C mov edx, dword ptr [rdx+12]
IN0008: 00001F mov dword ptr [V08 rsp+2CH], edx
IN0009: 000023 mov edx, dword ptr [V05 rsp+20H]

after:

IN0001: 000008 movups xmm0, xmmword ptr [rdx]
IN0002: 00000B movups xmmword ptr [V03 rsp+20H], xmm0
IN0003: 000010 mov edx, dword ptr [V05 rsp+20H]

@sandreenkosandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 16, 2020
// If we passed the above checks, then we will check these two
if (!requiresCopyBlock)
{
// It is not always profitable to do field by field init for structs that are allocated to memory.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

found after Carol's similar change for block init #36146

@sandreenko

Copy link
Copy Markdown
ContributorAuthor

PTAL @CarolEidt @dotnet/jit-contrib

@CarolEidtCarolEidt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - thanks! and thanks for the detailed comments

@sandreenko

Copy link
Copy Markdown
ContributorAuthor

The failures are known unrelated issues,

@sandreenko
sandreenko merged commit 0efeb9f into dotnet:masterJun 16, 2020
@ghostghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR 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.

2 participants

@sandreenko@CarolEidt