diff options
| author | Mark Mansi <markm@cs.wisc.edu> | 2019-11-12 11:21:50 -0600 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2019-11-14 13:08:20 -0600 |
| commit | f583948e83a0fee0f0f850808a0e1785810896ab (patch) | |
| tree | cde494c4ba0ebbe380c2abe996a916a3ac7491c4 /src/doc/rustc-dev-guide | |
| parent | 7ecacb4af5e3de2386a97ad406ab98e73b8881b2 (diff) | |
| download | rust-f583948e83a0fee0f0f850808a0e1785810896ab.tar.gz rust-f583948e83a0fee0f0f850808a0e1785810896ab.zip | |
add oli note
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/appendix/glossary.md | 1 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/optimizations.md | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/src/appendix/glossary.md b/src/doc/rustc-dev-guide/src/appendix/glossary.md index 5b0f7cfa2aa..d737e037f58 100644 --- a/src/doc/rustc-dev-guide/src/appendix/glossary.md +++ b/src/doc/rustc-dev-guide/src/appendix/glossary.md @@ -45,6 +45,7 @@ LTO | Link-Time Optimizations. A set of optimizations offer memoize | memoization is the process of storing the results of (pure) computations (such as pure function calls) to avoid having to repeat them in the future. This is typically a trade-off between execution speed and memory usage. MIR | the Mid-level IR that is created after type-checking for use by borrowck and codegen ([see more](../mir/index.html)) miri | an interpreter for MIR used for constant evaluation ([see more](../miri.html)) +monomorphize | Monomorphization is the process of taking generic implementations of types and functions and producing instantiating them with concrete types. For example, in the code we might have `Vec<T>`, but in the final executable, we will have a copy of the `Vec` code for every concrete type used in the program (e.g. a copy for `Vec<usize>`, a copy for `Vec<MyStruct>`, etc). normalize | a general term for converting to a more canonical form, but in the case of rustc typically refers to [associated type normalization](../traits/associated-types.html#normalize) newtype | a "newtype" is a wrapper around some other type (e.g., `struct Foo(T)` is a "newtype" for `T`). This is commonly used in Rust to give a stronger type for indices. NLL | [non-lexical lifetimes](../borrow_check/region_inference.html), an extension to Rust's borrowing system to make it be based on the control-flow graph. diff --git a/src/doc/rustc-dev-guide/src/mir/optimizations.md b/src/doc/rustc-dev-guide/src/mir/optimizations.md index fb550af4cd7..cb60af1af86 100644 --- a/src/doc/rustc-dev-guide/src/mir/optimizations.md +++ b/src/doc/rustc-dev-guide/src/mir/optimizations.md @@ -3,9 +3,13 @@ MIR optimizations are optimizations run on the [MIR][mir] to produce better MIR before codegen. This is important for two reasons: first, it make the final generated executable code better, and second, it means that LLVM has less work -to do, so compilation is faster. +to do, so compilation is faster. Note that since MIR is generic (not +[monomorphized][monomorph] yet), these optimizations are particularly +effective; we can optimize the generic version, so all of the monomorphizations +are cheaper! [mir]: https://rust-lang.github.io/rustc-guide/mir/index.html +[monomorph]: https://rust-lang.github.io/rustc-guide/appendix/glossary.html?highlight=monomorphize#appendix-c-glossary MIR optimizations run after borrow checking. We run a series of optimization passes over the MIR to improve it. Some passes are required to run on all code, |
