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

2 small CQ optimizations. #37967

Merged
merged 2 commits into from Jun 16, 2020
Merged

Conversation

sandreenko
Copy link
Contributor

@sandreenko sandreenko commented Jun 16, 2020

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]

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 16, 2020
@@ -10600,8 +10600,20 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree)
// 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
Contributor Author

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
Contributor Author

PTAL @CarolEidt @dotnet/jit-contrib

Copy link
Contributor

@CarolEidt CarolEidt left a comment

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
Contributor Author

The failures are known unrelated issues,

@sandreenko sandreenko merged commit 0efeb9f into dotnet:master Jun 16, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 8, 2020
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.

None yet

2 participants