rust/compiler/rustc_codegen_ssa
bors 7425fb293f Auto merge of #98377 - davidv1992:add-lifetimes-to-argument-temporaries, r=oli-obk
Added llvm lifetime annotations to function call argument temporaries.

The goal of this change is to ensure that llvm will do stack slot
optimization on these temporaries. This ensures that in code like:
```rust
const A: [u8; 1024] = [0; 1024];

fn copy_const() {
    f(A);
    f(A);
}
```
we only use 1024 bytes of stack space, instead of 2048 bytes.

I am new to developing for the rust compiler, and as such not entirely sure, but I believe this should be sufficient to close #98156.

Also, this does not contain a test case to ensure this keeps working, primarily because I am not sure how to go about testing this. I would love some suggestions as to how that could be approached.
2022-06-30 09:20:52 +00:00
..
src Auto merge of #98377 - davidv1992:add-lifetimes-to-argument-temporaries, r=oli-obk 2022-06-30 09:20:52 +00:00
Cargo.toml Update smallvec to 1.8.1. 2022-06-27 08:48:55 +10:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.