rust/compiler
bors bc888958c9 Auto merge of #111440 - cjgillot:refprop-debuginfo, r=oli-obk
Allow MIR debuginfo to point to a variable's address

MIR optimizations currently do not to operate on borrowed locals.

When enabling #106285, many borrows will be left as-is because they are used in debuginfo. This pass allows to replace this pattern directly in MIR debuginfo:
```rust
a => _1
_1 = &raw? mut? _2
```
becomes
```rust
a => &_2
// No statement to borrow _2.
```

This pass is implemented as a drive-by in ReferencePropagation MIR pass.

This transformation allows following following MIR opts to treat _2 as an unborrowed local, and optimize it as such, even in builds with debuginfo.

In codegen, when encountering `a => &..&_2`, we create a list of allocas:
```llvm
store ptr %_2.dbg.spill, ptr %a.ref0.dbg.spill
store ptr %a.ref0.dbg.spill, ptr %a.ref1.dbg.spill
...
call void `@llvm.dbg.declare(metadata` ptr %a.ref{n}.dbg.spill, /* ... */)
```

Caveat: this transformation looses the exact type, we do not differentiate `a` as a immutable, mutable reference or a raw pointer. Everything is declared to `*mut` to codegen. I'm not convinced this is a blocker.
2023-05-14 05:31:10 +00:00
..
rustc
rustc_abi
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_ast_lowering Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
rustc_ast_passes
rustc_ast_pretty
rustc_attr
rustc_baked_icu_data
rustc_borrowck Rollup merge of #110454 - oli-obk:limited_impl_trait_in_assoc_type, r=compiler-errors 2023-05-13 11:05:32 +05:30
rustc_builtin_macros Auto merge of #109732 - Urgau:uplift_drop_forget_ref_lints, r=davidtwco 2023-05-12 12:04:32 +00:00
rustc_codegen_cranelift
rustc_codegen_gcc
rustc_codegen_llvm Rollup merge of #111375 - rcvalle:rust-cfi-fix-106547, r=bjorn3 2023-05-11 17:43:07 -07:00
rustc_codegen_ssa Auto merge of #111440 - cjgillot:refprop-debuginfo, r=oli-obk 2023-05-14 05:31:10 +00:00
rustc_const_eval Implement references VarDebugInfo. 2023-05-13 10:12:14 +00:00
rustc_data_structures Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_driver
rustc_driver_impl Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_error_codes
rustc_error_messages
rustc_errors Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_expand
rustc_feature Add support for cfg(overflow_checks) 2023-05-11 18:06:31 +04:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
rustc_hir_analysis Add a convenience function 2023-05-12 10:25:34 +00:00
rustc_hir_pretty
rustc_hir_typeck Use the opaque_types_defined_by query to cheaply check for whether a hidden type may be registered for an opaque type 2023-05-12 10:26:50 +00:00
rustc_incremental
rustc_index
rustc_infer Rollup merge of #110454 - oli-obk:limited_impl_trait_in_assoc_type, r=compiler-errors 2023-05-13 11:05:32 +05:30
rustc_interface Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_lexer
rustc_lint Auto merge of #111425 - Bryanskiy:privacy_ef, r=petrochenkov 2023-05-14 02:53:52 +00:00
rustc_lint_defs
rustc_llvm Usage of atomic counters for llvm code coverage 2023-05-12 01:40:04 +03:00
rustc_log
rustc_macros
rustc_metadata Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_middle Auto merge of #111440 - cjgillot:refprop-debuginfo, r=oli-obk 2023-05-14 05:31:10 +00:00
rustc_mir_build Implement references VarDebugInfo. 2023-05-13 10:12:14 +00:00
rustc_mir_dataflow Auto merge of #110820 - cjgillot:faster-dcp, r=oli-obk 2023-05-10 20:54:31 +00:00
rustc_mir_transform Do not ICE on deeply nested borrows. 2023-05-13 10:29:05 +00:00
rustc_monomorphize
rustc_parse
rustc_parse_format
rustc_passes
rustc_plugin_impl
rustc_privacy Populate effective visibilities in rustc_privacy 2023-05-11 14:51:01 +03:00
rustc_query_impl
rustc_query_system
rustc_resolve Auto merge of #111425 - Bryanskiy:privacy_ef, r=petrochenkov 2023-05-14 02:53:52 +00:00
rustc_serialize
rustc_session Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_smir
rustc_span Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_symbol_mangling
rustc_target asm: loongarch64: Drop efiapi 2023-05-12 17:22:47 +08:00
rustc_trait_selection Note base types of coercion 2023-05-12 00:10:52 +00:00
rustc_traits
rustc_transmute
rustc_ty_utils Use the opaque_types_defined_by query to cheaply check for whether a hidden type may be registered for an opaque type 2023-05-12 10:26:50 +00:00
rustc_type_ir Implement references VarDebugInfo. 2023-05-13 10:12:14 +00:00