Use `push` for 8/12 byte struct args on x86 (#65387)
authorSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Thu, 17 Feb 2022 17:18:35 +0000 (20:18 +0300)
committerGitHub <noreply@github.com>
Thu, 17 Feb 2022 17:18:35 +0000 (09:18 -0800)
commit87d6d584476890e3a89d626cc9eec59538c05951
treec6dcad2f7ed1a451f859a927fed708a59c9216fe
parent310406dc51da499aa0d7b0a2e2ec27db2a1c7a7d
Use `push` for 8/12 byte struct args on x86 (#65387)

* Refactor struct PUTARG_STK codegen

Two changes:

 1) Outline cases for GC pointers from "genPutStructArgStk" into
    their own functions. Helps with readability, will be used in
    the substative portion of the change.
 2) Do not use "Kind::Push" for a case of a struct less than 16
    bytes in size, that does not have GC pointers, on x86. With
    this, we will now always call "genStructPutArgUnroll" for
    the "Unroll" kind. This means "genAdjustStackForPutArgStk"
    has to special-case that. This will go away in the final
    version of the change.

No diffs on x86 or Unix-x64 (the only two affected platforms).

* Remove the LSRA quirk

We're not using XMMs on the "push" path.

* Use "push" for structs less than 16 bytes in size

It is smaller and a little faster than using an XMM
register to first load and then store the struct.

* Add an assert to genStructPutArgPush
src/coreclr/jit/codegen.h
src/coreclr/jit/codegenxarch.cpp
src/coreclr/jit/gentree.cpp
src/coreclr/jit/gentree.h
src/coreclr/jit/lowerxarch.cpp
src/coreclr/jit/lsraxarch.cpp