rust/compiler/rustc_middle/src
bors e7c502d930 Auto merge of #109597 - cjgillot:gvn, r=oli-obk
Implement a global value numbering MIR optimization

The aim of this pass is to avoid repeated computations by reusing past assignments. It is based on an analysis of SSA locals, in order to perform a restricted form of common subexpression elimination.

By opportunity, this pass allows for some simplifications by combining assignments. For instance, this pass could be able to see through projections of aggregates to directly reuse the aggregate field (not in this PR).

We handle references by assigning a different "provenance" index to each `Ref`/`AddressOf` rvalue. This ensure that we do not spuriously merge borrows that should not be merged. Meanwhile, we consider all the derefs of an immutable reference to a freeze type to give the same value:
```rust
_a = *_b // _b is &Freeze
_c = *_b // replaced by _c = _a
```
2023-09-27 21:06:30 +00:00
..
dep_graph Move DepKind to rustc_query_system and define it as u16 2023-09-21 17:06:14 +02:00
hir Don't store lazyness in DefKind 2023-09-26 02:53:59 +00:00
hooks Add tracing instrumentation, just like queries automatically add it 2023-09-22 09:25:38 +00:00
infer Remove span from BrAnon. 2023-09-24 09:46:55 +00:00
middle Rework no_coverage to coverage(off) 2023-09-08 12:46:06 +01:00
mir Auto merge of #109597 - cjgillot:gvn, r=oli-obk 2023-09-27 21:06:30 +00:00
query Don't store lazyness in DefKind 2023-09-26 02:53:59 +00:00
thir rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const 2023-09-21 08:12:30 +02:00
traits Check types live across yields in generators too 2023-09-23 04:19:14 +00:00
ty Auto merge of #116163 - compiler-errors:lazyness, r=oli-obk 2023-09-27 01:48:53 +00:00
util Merge ExternProviders into the general Providers struct 2023-09-22 20:15:34 +00:00
arena.rs Remove metadata_loader query 2023-08-13 16:38:50 +00:00
error.rs don't point at const usage site for resolution-time errors 2023-09-14 22:34:05 +02:00
lib.rs Add a way to decouple the implementation and the declaration of a TyCtxt method. 2023-09-22 09:23:15 +00:00
lint.rs give FutureIncompatibilityReason variants more explicit names 2023-09-22 08:51:18 +02:00
macros.rs Rename CloneLiftImpls as TrivialLiftImpls. 2023-09-18 09:37:09 +10:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Auto merge of #115887 - RalfJung:pat, r=oli-obk 2023-09-27 13:20:53 +00:00
values.rs Don't store lazyness in DefKind 2023-09-26 02:53:59 +00:00