@@ -28,13 +28,13 @@ optimizes it, and returns the improved MIR.
28
28
29
29
## Quickstart for adding a new optimization
30
30
31
- 1 . Make a Rust source file in ` src/test /mir-opt` that shows the code you want to
31
+ 1 . Make a Rust source file in ` tests /mir-opt` that shows the code you want to
32
32
optimize. This should be kept simple, so avoid ` println! ` or other formatting
33
33
code if it's not necessary for the optimization. The reason for this is that
34
34
` println! ` , ` format! ` , etc. generate a lot of MIR that can make it harder to
35
35
understand what the optimization does to the test.
36
36
37
- 2 . Run ` ./x.py test --bless src/test /mir-opt/<your-test>.rs ` to generate a MIR
37
+ 2 . Run ` ./x.py test --bless tests /mir-opt/<your-test>.rs ` to generate a MIR
38
38
dump. Read [ this README] [ mir-opt-test-readme ] for instructions on how to dump
39
39
things.
40
40
@@ -51,10 +51,10 @@ optimizes it, and returns the improved MIR.
51
51
[ ` run_optimization_passes() ` ] function,
52
52
3 . and then start modifying the copied optimization.
53
53
54
- 5 . Rerun ` ./x.py test --bless src/test /mir-opt/<your-test>.rs ` to regenerate the
54
+ 5 . Rerun ` ./x.py test --bless tests /mir-opt/<your-test>.rs ` to regenerate the
55
55
MIR dumps. Look at the diffs to see if they are what you expect.
56
56
57
- 6 . Run ` ./x.py test src/test /ui ` to see if your optimization broke anything.
57
+ 6 . Run ` ./x.py test tests /ui ` to see if your optimization broke anything.
58
58
59
59
7 . If there are issues with your optimization, experiment with it a bit and
60
60
repeat steps 5 and 6.
@@ -70,7 +70,7 @@ optimizes it, and returns the improved MIR.
70
70
If you have any questions along the way, feel free to ask in
71
71
` #t-compiler/wg-mir-opt ` on Zulip.
72
72
73
- [ mir-opt-test-readme ] : https://github.com/rust-lang/rust/blob/master/src/test /mir-opt/README.md
73
+ [ mir-opt-test-readme ] : https://github.com/rust-lang/rust/blob/master/tests /mir-opt/README.md
74
74
[ `compiler/rustc_mir_transform/src` ] : https://github.com/rust-lang/rust/tree/master/compiler/rustc_mir_transform/src
75
75
<!-- - TODO: Change NoLandingPads. [#1232](https://github.com/rust-lang/rustc-dev-guide/issues/1232) -->
76
76
[ `no_landing_pads` ] : https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/no_landing_pads.rs
0 commit comments