diff options
| author | bors <bors@rust-lang.org> | 2016-08-14 12:28:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-14 12:28:48 -0700 |
| commit | 1d5b758bab979b1db723bcc97ecd8398127bd8bc (patch) | |
| tree | 3375e24d086cd3d3927471388e8ade7fbf4f9666 /src/rustllvm/RustWrapper.cpp | |
| parent | 92ae4ceb6c6563b983a046f5f273cc13247eb4b1 (diff) | |
| parent | 1bb14445160329c2ca5ff9c202e791ca0098d944 (diff) | |
| download | rust-1d5b758bab979b1db723bcc97ecd8398127bd8bc.tar.gz rust-1d5b758bab979b1db723bcc97ecd8398127bd8bc.zip | |
Auto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakis
[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.
Storage live ranges are tracked for all MIR variables and temporaries with a drop scope.
`StorageLive` is lowered to `llvm.lifetime.start` and `StorageDead` to `llvm.lifetime.end`.
There are some improvements possible here, such as:
* pack multiple storage liveness statements by using the index of first local + `u64` bitset
* enforce that locals are not directly accessed outside their storage live range
* shrink storage live ranges for never-borrowed locals to initialization -> last use
* emit storage liveness statements for *all* temporaries
* however, the remaining ones are *always* SSA immediates, so they'd be noop in MIR trans
* could have a flag on the temporary that its storage is irrelevant (a la C's old `register`)
* would also deny borrows if necessary
* this seems like an overcompliation and with packing & optimizations it may be pointless
Even in the current state, it helps stage2 `rustc` compile `boiler` without overflowing (see #35408).
A later addition fixes #26764 and closes #27372 by emitting `.section` directives for dylib metadata to avoid them being allocated into memory or read as `.note`. For this PR, those bugs were tripping valgrind.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
