Add optimization to avoid copying a struct if passed by reference and there are no writes to and no reads after passed to a callee. #4524
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
needs-author-action
An issue or pull request that requires more info or actions from the author.
optimization
tenet-performance
Performance related issue
Milestone
On Windows structs are allocated on the caller stack and passed by ref to the callee.
If a struct is passed to a callee (callee1), which passes it to another callee (calee2), and there are no writes before the call to callee2, and there are no reads after passing to the callee2, the callee1 could pass to calee2 the reference that was passed to it, without need to allocate a new struct on the callee1 stack and copy the data.
category:cq
theme:structs
skill-level:expert
cost:extra-large
The text was updated successfully, but these errors were encountered: