]> git.lizzy.rs Git - rust.git/commit
Omit lifetime intrinsics for function arguments and similar top-level items
authorBjörn Steinbrink <bsteinbr@gmail.com>
Tue, 25 Aug 2015 16:33:55 +0000 (18:33 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Tue, 25 Aug 2015 16:37:02 +0000 (18:37 +0200)
commit9a15d664a67137028bb0d32eab56698b18356e6d
tree99ed853ae3a1045e95472824e57464ac2868ee34
parent727a5d543d662231224002c3345f78b0bebf8c6b
Omit lifetime intrinsics for function arguments and similar top-level items

Function arguments are live for the whole function scope, so adding
lifetime intrinsics around them adds no value. The same is true for drop
hint allocas and everything else that goes directly through
lvalue_scratch_datum. So the easiest fix is to emit lifetime intrinsics
only for lvalue datums that are created in to_lvalue_datum_in_scope().

The reduces peak memory usage and LLVM times by about 1-4%, depending on
the crate.
src/librustc_trans/trans/datum.rs