Unix: Unnecessary struct copy while passsing struct of size <=16 #10879
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
enhancement
Product code improvement that does NOT require public API changes/additions
optimization
os-linux
Linux OS (any supported distro)
tenet-performance
Performance related issue
Milestone
This is a copy of #6316. For some reason it wasn't possible to update the description of that issue.
Struct arguments whose size is <= 16 bytes generate unnecessary copies. @sivarv categorized the cases below:
The following are the struct passing cases on Amd64 Unix that are of interest:
struct of size 1,2,4 or 8 in memory/register is getting passed in an arg reg or on stack
struct of size 3,5,6,7 in memory/register is getting passed in an arg reg or on stack
struct of size 9-16 bytes in memory is getting passed in two arg registers
struct of size 9-16 bytes (e.g. SIMD structs Vector3 and Vector4) in a register is getting passed in two arg registers
struct of size 9-16 bytes in memory/register is getting passed on stack.
In fgMorphArgs, eeGetSystemVAmd64PassStructInRegisterDescriptor classifies the cases above as register argument except simd from vector and sets structDesc.passedInRegisters to true, this always calls fgMakeOutgoingStructArgCopy() and generates copies.
category:cq
theme:calling-convention
skill-level:intermediate
cost:medium
impact:small
The text was updated successfully, but these errors were encountered: