about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2020-09-03 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2020-09-04 02:33:37 +0200
commit01510612ee20d14a3397427891a4042a34d53956 (patch)
tree7d61c84405b01c0201aec4f80612f34a7daf2420 /compiler/rustc_codegen_llvm/src
parent0d0f6b113047b2cf9afbde990cee30fd5b866469 (diff)
downloadrust-01510612ee20d14a3397427891a4042a34d53956.tar.gz
rust-01510612ee20d14a3397427891a4042a34d53956.zip
NRVO: Allow occurrences of the return place in var debug info
The non-use occurrence of the return place in var debug info does not
currently inhibit NRVO optimization, but it will fail assertion in
`visit_place` when optimization is performed.

Relax assertion check to allow the return place in var debug info.

This case might be impossible to hit in optimization pipelines as of
now, but can be encountered in customized mir-opt-level=2 pipeline with
copy propagation disabled. For example in:

```
pub fn b(s: String) -> String {
    a(s)
}

#[inline]
pub fn a(s: String) -> String {
    let x = s;
    let y = x;
    y
}
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions