Skip to content

introduce dirty list to liveness, eliminate ins vector #51896

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Jul 2, 2018

Conversation

nikomatsakis
Copy link
Contributor

At least in my measurements, this seems to knock much of the liveness computation off the profile.

r? @Zoxc
cc @nnethercote

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 29, 2018
@nikomatsakis
Copy link
Contributor Author

@bors try

@bors
Copy link
Collaborator

bors commented Jun 29, 2018

⌛ Trying commit 58ee87d with merge c27e6f7936761b7b1ff3b3db58ceb9d7fec0cf34...

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:start:test_mir-opt
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:56:46] 
[00:56:46] running 50 tests
[00:56:59] ERROR 2018-06-29T12:04:08Z: compiletest::runtest: None
[00:57:08] | Inferred Region Values
[00:57:08] | '_#0r    | {'_#0r, bb0[0..=1], bb1[0], bb2[0..=1], bb3[0], bb4[0], bb5[0], bb6[0], bb7[0..=2], bb8[0..=1]}
[00:57:08] | '_#1r    | {'_#1r, bb0[0..=1], bb1[0], bb2[0..=1], bb3[0], bb4[0], bb5[0], bb6[0], bb7[0..=2], bb8[0..=1]}
[00:57:08] | Inference Constraints
[00:57:08] | Inference Constraints
[00:57:08] | '_#0r live at {'_#0r, bb0[0..=1], bb1[0], bb2[0..=1], bb3[0], bb4[0], bb5[0], bb6[0], bb7[0..=2], bb8[0..=1]}
[00:57:08] | '_#1r live at {'_#1r, bb0[0..=1], bb1[0], bb2[0..=1], bb3[0], bb4[0], bb5[0], bb6[0], bb7[0..=2], bb8[0..=1]}
[00:57:08] fn main() -> (){
[00:57:08]     let mut _0: ();
[00:57:08]     scope 1 {
[00:57:08]     scope 2 {
[00:57:08]     scope 2 {
[00:57:08]         let mut _1: std::boxed::Box<usize>;
[00:57:08]     }
[00:57:08]     let mut _2: std::boxed::Box<usize>;
[00:57:08]     bb0: {                              
[00:57:08]                                          | Live variables on entry to bb0[0]: []
[00:57:08]         StorageLive(_1);
[00:57:08]                                          | Live variables on entry to bb0[1]: []
[00:57:08]         _1 = const <std::boxed::Box<T>>::new(const 22usize) -> [return: bb2, unwind: bb1];
[00:57:08]     | Live variables on entry to bb0: [_1 (drop)]
[00:57:08]     bb1: {
[00:57:08]     bb1: {
[00:57:08]                                          | Live variables on entry to bb1[0]: []
[00:57:08]         resume;
[00:57:08]     | Live variables on entry to bb1: []
[00:57:08]     }
[00:57:08]     bb2: {                              
[00:57:08]                                          | Live variables on entry to bb2[0]: [_1try to bb3[3]: [_1]
[00:57:08]        _4 = _1;
[00:57:08]            | Live variables on entry to bb3[4]: [_4]
[00:57:08]        _3 = const use_x(move _4) -> [return: bb4, unwind: bb1];
[00:57:08] Actual:
[00:57:08] | Free Region Mapping
[00:57:08] | Free Region Mapping
[00:57:08] | '_#0r    | Global   | ['_#0r, '_#1r]
[00:57:08] | '_#1r    | Local    | ['_#1r]
[00:57:08] | Inferred Region Values
[00:57:08] | Inferred Region Values
[00:57:08] | '_#0r    | {'_#0r, bb0[0..=2], bb1[0], bb2[0], bb3[0..=4], bb4[0..=1], bb5[0..=3], bb6[0..=2]}
[00:57:08] | '_#1r    | {'_#1r, bb0[0..=2], bb1[0], bb2[0], bb3[0..=4], bb4[0..=1], bb5[0..=3], bb6[0..=2]}
[00:57:08] | Inference Constraints
[00:57:08] | Inference Constraints
[00:57:08] | '_#0r live at {'_#0r, bb0[0..=2], bb1[0], bb2[0], bb3[0..=4], bb4[0..=1], bb5[0..=3], bb6[0..=2]}
[00:57:08] | '_#1r live at {'_#1r, bb0[0..=2], bb1[0], bb2[0], bb3[0..=4], bb4[0..=1], bb5[0..=3], bb6[0..=2]}
[00:57:08] fn main() -> (){
[00:57:08]     let mut _0: ();
[00:57:08]     scope 1 {
[00:57:08]     scope 2 {
[00:57:08]         let mut _1: usize;
[00:57:08]     }
[00:57:08]     }
[00:57:08]     let mut _2: ();
[00:57:08]     let mut _3: bool;
[00:57:08]     let mut _4: usize;
[00:57:08]     let mut _5: !;
[00:57:08]     bb0: {                              
[00:57:08]                                          | Live variables on entry to bb0[0]: []
[00:57:08]         StorageLive(_1);
[00:57:08]                                          | Live variables on entry to bb0[1]: []
[00:57:08]         _1 = const 22usize;
[00:57:08]                                          | Live variables on entry to bb0[2]: []
[00:57:08]         goto -y to bb4[1]: [_3]
[00:57:08]         switchInt(move _3) -> [false: bb6, otherwise: bb5];
[00:57:08]     | Live variables on entry to bb4: []
[00:57:08]     }
[00:57:08]     bb5: {                              
[00:57:08]                                          | Live variables on entry to bb5[0]: []
[00:57:08]         _0 = ();
[00:57:08]                                          | Live variables on entry to bb5[1]: []
[00:57:08]         StorageDead(_3);
[00:57:08]                                          | Live variables on entry to bb5[2]: []
[00:57:08]         StorageDead(_1);
[00:57:08]                                          | Live variables on entry to bb5[3]: []
[00:57:08]         return;
[00:57:08]     | Live variables on entry to bb5: []
[00:57:08]     }
[00:57:08]     bb6: {                              
[00:57:08]                                          | Live variables on entry to bb6[0]: []
[00:57:08]         _2 = ();
[00:57:08]                                          | Live variables on entry to bb6[1]: []
[00:57:08]         StorageDead(_3);
[00:57:08]                                          | Live variables on entry to bb6[2]: []
[00:57:08]         goto -> bb2;
[00:57:08]     | Live variables on entry to bb6: []
[00:57:08] }', tools/compiletest/src/runtest.rs:2816:13
[00:57:08] 
[00:57:08] ---- [mir-opt] mir-opt/nll/liveness-interblock.rs stdout ----
[00:57:08] ---- [mir-opt] mir-opt/nll/liveness-interblock.rs stdout ----
[00:57:08] thread '[mir-opt] mir-opt/nll/liveness-interblock.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
[00:57:08] Expected Line: "    | Live variables on entry to bb3: [_1]"
[00:57:08] Test Name: rustc.main.nll.0.mir
[00:57:08] Expected:
[00:57:08] ... (elided)
[00:57:08]     | Live variables on entry to bb3: [_1]
[00:57:08]     bb3: {
[00:57:08]             | Live variables on entry to bb3[0]: [_1]
[00:57:08]         StorageLive(_4);
[00:57:08]             | Live variables on entry to bb3[1]: [_1]
[00:57:08]         _4 = _1;
[00:57:08]             | Live variables on entry to bb3[2]: [_4]
[00:57:08]         _3 = const make_live(move _4) -> [return: bb5, unwind: bb1];
[00:57:08] Actual:
[00:57:08] | Free Region Mapping
[00:57:08] | Free Region Mapping
[00:57:08] | '_#0r    | Global   | ['_#0r, '_#1r]
[00:57:08] | '_#1r    | Local    | ['_#1r]
[00:57:08] | Inferred Region Values
[00:57:08] | Inferred Region Values
[00:57:08] | '_#0r    | {'_#0r, bb0[0..=3], bb1[0], bb2[0], bb3[0..=2], bb4[0], bb5[0..=2], bb6[0..=1], bb7[0..=2]}
[00:57:08] | '_#1r    | {'_#1r, bb0[0..=3], bb1[0], bb2[0], bb3[0..=2], bb4[0], bb5[0..=2], bb6[0..=1], bb7[0..=2]}
[00:57:08] | Inference Constraints
[00:57:08] | Inference Constraints
[00:57:08] | '_#0r live at {'_#0r, bb0[0..=3], bb1[0], bb2[0], bb3[0..=2], bb4[0], bb5[0..=2], bb6[0..=1], bb7[0..=2]}
[00:57:08] | '_#1r live at {'_#1r, bb0[0..=3], bb1[0], bb2[0], bb3[0..=2], bb4[0], bb5[0..=2], bb6[0..=1], bb7[0..=2]}
[00:57:08] fn main() -> (){
[00:57:08]     let mut _0: ();
[00:57:08]     scope 1 {
[00:57:08]     scope 2 {
[00:57:08]         let _1: usize;
[00:57:08]     }
[00:57:08]     }
[00:57:08]     let mut _2: bool;
[00:57:08]     let mut _3: ();
[00:57:08]     let mut _4: usize;
[00:57:08]     let mut _5: ();
[00:57:08]     bb0: {                              
[00:57:08]             bb3: []
[00:57:08]     }
[00:57:08]     bb4: {                              
[00:57:08]                                          | Live variables on entry to bb4[0]: []
[00:57:08]         _5 = const make_dead() -> [return: bb6, unwind: bb1];
[00:57:08]     | Live variables on entry to bb4: []
[00:57:08]     }
[00:57:08]     bb5: {                              
[00:57:08]                                          | Live variables on entry to bb5[0]: []
[00:57:08]         StorageDead(_4);
[00:57:08]                                          | Live variables on entry to bb5[1]: []
[00:57:08]         _0 = ();
[00:57:08]                                          | Live variables on entry to bb5[2]: []
[00:57:08]         goto -> bb7;
[00:57:08]     | Live variables on entry to bb5: []
[00:57:08]     }
[00:57:08]     bb6: {                              
[00:57:08]                                          | Live variables on entry to bb6[0]: []
[00:57:08]         _0 = ();
[00:57:08]                                          | Live variables on entry to bb6[1]: []
[00:57:08]         goto -> bb7;
[00:57:08]     | Live variables on entry to bb6: []
[00:57:08]     }
[00:57:08]     bb7: {                              
[00:57:08]                                          | Live variables on entry to bb7[0]: []
[00:57:08]         StorageDead(_2);
[00:57:08]                                          | Live variables on entry to bb7[1]: []
[00:57:08]         StorageDead(_1);
[00:57:08]                                          | Live variables on entry to bb7[2]: []
[00:57:08]         return;
[00:57:08]     | Live vari0..=1], bb7[0..=3]}
[00:57:08] | '_#2r live at {bb2[0]}
[00:57:08] | '_#3r live at {bb2[1], bb3[0..=1]}
[00:57:08] | '_#2r: '_#3r @ bb2[1] due to /checkout/src/test/mir-opt/nll/region-liveness-basic.rs:24:13: 24:18
[00:57:08] fn main() -> (){
[00:57:08]     let mut _0: ();
[00:57:08]     scope 1 {
[00:57:08]         scope 3 {
[00:57:08]         scope 4 {
[00:57:08]         scope 4 {
[00:57:08]             let _2: &'_#3r usize;
[00:57:08]     }
[00:57:08]     scope 2 {
[00:57:08]     scope 2 {
[00:57:08]         let mut _1: [usize; 3];
[00:57:08]     let mut _3: usize;
[00:57:08]     let mut _4: usize;
[00:57:08]     let mut _4: usize;
[00:57:08]     let mut _5: bool;
[00:57:08]     let mut _6: bool;
[00:57:08]     let mut _7: usize;
[00:57:08]     let mut _8: bool;
[00:57:08]     bb0: {                              
[00:57:08]                                          | Live variables on entry to bb0[0]: []
[00:57:08]         StorageLive(_1);
[00:57:08]                                          | Live variables on entry to bb0[1]: []
[00:57:08]         _1 = [const 1usize, const 2usize, const 3usize];
[00:57:08]                                          | Live variables on entry to bb0[2]: [_1]
[00:57:08]         StorageLive(_2);
[00:57:08]                                          | Live variables on entry to bb0[3]: [_1]
[00:57:08]         StorageLive(_3);
[00:57:08]                                          | Live variables on entry to bb0[4]: [_1]
[00:57:08]         _3 = const 0usize;
[00:57:08]                                          | Live variables on entry to bb0[5]: [_1, _3]
[00:57:08]         _4 = Len(_1);
[00:57:08]                                          | Live variables on entry to bb0[6]: [_1, _3, _4]
[00:57:08]         _5 = Lt(_3, _4);
[00:57:08]                                          | Live variables on entry to bb0[7]: [_1, _3, _4, _5]
[00:57:08]         assert(move _5, "index out of bounds: the len is move _4 but the index is _3") -> [success: bb2, unwind: bb1];
[00:57:08]     | Live variables on entry to bb0: [_1, _3]
[00:57:08]     bb1: {
[00:57:08]     bb1: {
[00:57:08]                                          | Live variables on entry to bb1[0]: []
[00:57:08]         resume;
[00:57:08]     | Live variables on entry to bb1: []
[00:57:08]     }
[00:57:08]     bb2: {                              
[00:57:08]                                          | Live variables on entry to bb2[0]: [_1, _3]
[00:57:08]         _2 = &'_#2r _1[_3];
[00:57:08]                                          | Live variables on entry to bb2[1]: [_2]
[00:57:08]         switchInt(const true) -> [false: bb4, otherwise: bb3];
[00:57:08]     | Live variables on entry to bb2: [_2]
[00:57:08]     }
[00:57:08]     bb3: {                              
[00:57:08]                                          | Live variables on entry to bb3[0]: [_2]
[00:57:08]         StorageLive(_7);
[00:57:08]                                          | Live variables on entry to bb3[1]: [_2]
[00:57:08]         _7 = (*_2);
[00:57:08]                                          | Live variables on entry to bb3[2]: [_7]
[00:57:08]         _6 = const use_x(move _7) -> [return: bb5, unwind: bb1];
[00:57:08]     | Live variables on entry to bb3: []
[00:57:08]     }
[   | Live variables on entry to bb7[3]: []
[00:57:08]         return;
[00:57:08]     | Live variables on entry to bb7: []
[00:57:08] }', tools/compiletest/src/runtest.rs:2816:13
[00:57:08] 
[00:57:08] 
[00:57:08] failures:
---
[00:57:08] test result: FAILED. 46 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out
[00:57:08] 
[00:57:08] 
[00:57:08] 
[00:57:08] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:57:08] 
[00:57:08] 
[00:57:08] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:57:08] Build completed unsuccessfully in 0:15:11
[00:57:08] Build completed unsuccessfully in 0:15:11
[00:57:08] make: *** [check] Error 1
[00:57:08] Makefile:58: recipe for target 'check' failed
33884 ./src/llvm-emscripten/lib/Target
32952 ./.git/modules/src/libcompiler_builtins
32188 ./.git/modules/src/libcompiler_builtins/modules
32184 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Collaborator

bors commented Jun 29, 2018

☀️ Test successful - status-travis
State: approved= try=True

@Mark-Simulacrum
Copy link
Member

Perf is queued.

@nikomatsakis
Copy link
Contributor Author

(I'm updating the broken tests, those are nothing serious, just waiting for the build on my local machine)

@nikomatsakis
Copy link
Contributor Author

Perf URLs will be:

@nikomatsakis
Copy link
Contributor Author

cc #51819

@kennytm kennytm added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 30, 2018
@bors
Copy link
Collaborator

bors commented Jul 1, 2018

☔ The latest upstream changes (presumably #51869) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis nikomatsakis force-pushed the nll-liveness-dirty-list branch from f140bca to 3f6fe5f Compare July 1, 2018 09:25
@nikomatsakis
Copy link
Contributor Author

Rebased. Perf results are ready and look good.

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:07:33]    Compiling proc_macro v0.0.0 (file:///checkout/src/libproc_macro)
[00:07:49]    Compiling syntax_ext v0.0.0 (file:///checkout/src/libsyntax_ext)
[00:13:42]    Compiling rustc_mir v0.0.0 (file:///checkout/src/librustc_mir)
[00:13:42]    Compiling rustc_typeck v0.0.0 (file:///checkout/src/librustc_typeck)
[00:13:44] error: unused import: `IdxSet`
[00:13:44]   --> librustc_mir/util/liveness.rs:39:42
[00:13:44]    |
[00:13:44] 39 | use rustc_data_structures::indexed_set::{IdxSet, IdxSetBuf};
[00:13:44]    |
[00:13:44]    = note: `-D unused-imports` implied by `-D warnings`
[00:13:44] 
[00:13:55] error: aborting due to previous error
[00:13:55] error: aborting due to previous error
[00:13:55] 
[00:13:55] error: Could not compile `rustc_mir`.
[00:13:55] 
[00:13:55] Caused by:
[00:13:55]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_mir librustc_mir/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=8fc603afb8ea9b13 -C extra-filename=-8fc603afb8ea9b13 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-d45628fe21047b42.so --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-d8b3f1986e621085.rlib --extern byteorder=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbyteorder-09e9dbd1ef48ffa5.rlib --extern either=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libeither-b51deb005c05dd3b.rlib --extern graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgraphviz-6020508f01da724d.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-023d781fbd65d983.rlib --extern log_settings=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog_settings-9c861d36e123bec8.rlib --extern polonius_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-2e546cbdf217aece.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-1dddb0fa9d8a512f.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-be9737b074a8dae0.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-25582ce13d3618ea.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-e036f8f5b9204e52.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-066098b54e835a1f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-05774896829b5d87.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-05774896829b5d87.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-a1b02e0d020520ac.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-f36f6cb494d373be.so -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-a59a4023b81a89b2/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-ea5907e223517cf2/out` (exit code: 101)
[00:15:32] error: build failed
[00:15:32] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:15:32] expected success, got: exit code: 101
[00:15:32] expected success, got: exit code: 101
[00:15:32] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:15:32] travis_fold:end:stage0-rustc

[00:15:32] travis_time:end:stage0-rustc:start=1530439328207216748,finish=1530439943588630252,duration=615381413504


[00:15:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:15:32] Build completed unsuccessfully in 0:10:27
[00:15:32] Makefile:28: recipe for target 'all' failed
[00:15:32] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f49b934
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nikomatsakis nikomatsakis force-pushed the nll-liveness-dirty-list branch from 3f6fe5f to 73f8333 Compare July 1, 2018 14:13
@nikomatsakis
Copy link
Contributor Author

cc @rust-lang/compiler — this would be nice to land for NLL (it's a modest gain, but a useful one, and there are several other PRs building on this code). If anybody is able to review, would be appreciated.

// bits were not already present, then enqueue the predecessor
// as dirty.
for &pred_bb in &predecessors[bb] {
if outs[pred_bb].union(&bits) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be a comment indicating that union returns true if it changes anything. I don't normally associate that with the union operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, those methods are undercommented. I'll add some comments. =)

bits.overwrite(&outs[bb]);
def_use[bb].apply(&mut bits);

// add `bits` to the out set for each predecessor; if those
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a remark that bits now contains the state at the entry point the block (and has the value the previous ins variable helt).

@@ -438,7 +432,6 @@ pub fn write_mir_fn<'a, 'tcx>(
.collect();
writeln!(w, "{} {{{}}}", prefix, live.join(", "))
};
print(w, " ", &result.ins)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of this is unfortunate. I don't know if anyone but me have used this for debugging though. It shouldn't be too hard to add code to compute ins on demand if needed though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have the code to recompute it -- and in fact in the MIR dump, we include those results. I could update this code to match I suppose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(That is, in the NLL MIR dump)

@Zoxc
Copy link
Contributor

Zoxc commented Jul 1, 2018

r=me with the comments added

@nikomatsakis
Copy link
Contributor Author

@bors r=Zoxc

I didn't modify the dumping code because I am running short of time. Easy enough to do in the future.

@bors
Copy link
Collaborator

bors commented Jul 2, 2018

📌 Commit 78ea952 has been approved by Zoxc

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2018
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 2, 2018
@nikomatsakis
Copy link
Contributor Author

@bors p=1

Bumping priority as a number of NLL PRs are blocked on this, and NLL perf itself is pretty high priority and time sensitive.

@bors
Copy link
Collaborator

bors commented Jul 2, 2018

⌛ Testing commit 78ea952 with merge 9363342...

bors added a commit that referenced this pull request Jul 2, 2018
introduce dirty list to liveness, eliminate `ins` vector

At least in my measurements, this seems to knock much of the liveness computation off the profile.

r? @Zoxc
cc @nnethercote
@bors
Copy link
Collaborator

bors commented Jul 2, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Zoxc
Pushing 9363342 to master...

@bors bors merged commit 78ea952 into rust-lang:master Jul 2, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-perf Status: Waiting on a perf run to be completed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants