Temporaries used for indirectly-passed const arguments should get lifetime markers #98156
Labels
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
See https://godbolt.org/z/Kn7b7nTnd.
Basically, this function:
uses twice as much stack space as this function:
This happens because:
In
copy_local
, locals get lifetime markers (@llvm.lifetime.start
/@llvm.lifetime.end
, orStorageLive
/StorageDead
in MIR), soa
andb
can reuse the same stack slot.In
copy_const
, the temporaries created to copyA
to the stack before the call do not get lifetime markers, so the two calls use two separate stack slots.@rustbot label T-compiler I-heavy
The text was updated successfully, but these errors were encountered: