Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[experiment] remove diverge_from in box expr building #89332

Closed
wants to merge 1 commit into from

Conversation

nbdd0121
Copy link
Contributor

See if some instruction count regressions can be regained from #89030

r? @ghost

@nbdd0121
Copy link
Contributor Author

@rylev could you do a perf run please?

@jonas-schievink
Copy link
Contributor

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 28, 2021
@bors
Copy link
Contributor

bors commented Sep 28, 2021

⌛ Trying commit 1aac85bb716c09304b313d69d30d74fe7e8e1a8e with merge 7b3d96ffe131afbf1b4626a6102c03f5352678c7...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 28, 2021

☀️ Try build successful - checks-actions
Build commit: 7b3d96ffe131afbf1b4626a6102c03f5352678c7 (7b3d96ffe131afbf1b4626a6102c03f5352678c7)

@rust-timer
Copy link
Collaborator

Queued 7b3d96ffe131afbf1b4626a6102c03f5352678c7 with parent 8f8092c, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7b3d96ffe131afbf1b4626a6102c03f5352678c7): comparison url.

Summary: This change led to small relevant improvements 🎉 in compiler performance.

  • Small improvement in instruction counts (up to -1.4% on incr-patched: io error 6144 builds of issue-46449)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 28, 2021
@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Oct 5, 2021

Trying another approach. This should have similar result, but the change is made in library not in compiler. Please have another perf run.

@the8472
Copy link
Member

the8472 commented Oct 6, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 6, 2021
@bors
Copy link
Contributor

bors commented Oct 6, 2021

⌛ Trying commit bd50bb2ab189a90a6413780f4d2536808b9a7e04 with merge d0848a1101a9caed97f1276d4326bfe2e6bdbc42...

@bors
Copy link
Contributor

bors commented Oct 6, 2021

☀️ Try build successful - checks-actions
Build commit: d0848a1101a9caed97f1276d4326bfe2e6bdbc42 (d0848a1101a9caed97f1276d4326bfe2e6bdbc42)

@rust-timer
Copy link
Collaborator

Queued d0848a1101a9caed97f1276d4326bfe2e6bdbc42 with parent d7539a6, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d0848a1101a9caed97f1276d4326bfe2e6bdbc42): comparison url.

Summary: This change led to moderate relevant mixed results 🤷 in compiler performance.

  • Moderate improvement in instruction counts (up to -1.5% on incr-patched: println builds of syn)
  • Small regression in instruction counts (up to 0.7% on full builds of deep-vector)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 6, 2021
@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Oct 6, 2021

As I expected the performance is largely similar to removing the diverging path. I have no idea why adding rustc_allocator_nounwind makes expand_crate slower though.

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Oct 6, 2021

cc @Amanieu, you might want to take the potential performance gain of this change (1aac85bb716c09304b313d69d30d74fe7e8e1a8e, the earlier timing run) into account when evaluating the performance difference of #88098, since the diverging path can only be hit with oom=panic enabled.

@apiraino apiraino added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 14, 2021
@nbdd0121 nbdd0121 mentioned this pull request Oct 20, 2021
@JohnCSimon
Copy link
Member

This needs to assign a reviewer.

@camelid
Copy link
Member

camelid commented Nov 9, 2021

r? rust-lang/libs

@the8472
Copy link
Member

the8472 commented Nov 9, 2021

This needs to assign a reviewer.

does it? it's still labeled as experiment

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Nov 9, 2021

I am unsure whether this should proceed. I can turn this into a PR that removes the unwinding path and gain a bit perf now, but it'll need to reverted anyway to support oom=panic.

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Nov 9, 2021

Also this is more T-compiler than T-libs.

@rustbot label: -T-libs +T-compiler

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 9, 2021
@camelid
Copy link
Member

camelid commented Nov 9, 2021

r? rust-lang/compiler

@rust-highfive rust-highfive assigned jackh726 and unassigned dtolnay Nov 9, 2021
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
................................i.............................F...
failures:

---- [mir-opt] mir-opt/uniform_array_move_out.rs stdout ----
30         StorageLive(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
31         _3 = SizeOf(i32);                // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
32         _4 = AlignOf(i32);               // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
-         _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+         _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> bb1; // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
34                                          // mir::Constant
35                                          // + span: $DIR/uniform_array_move_out.rs:5:14: 5:19
36                                          // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }

49         StorageLive(_7);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
50         _8 = SizeOf(i32);                // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
51         _9 = AlignOf(i32);               // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
-         _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+         _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> bb3; // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
53                                          // mir::Constant
54                                          // + span: $DIR/uniform_array_move_out.rs:5:21: 5:26
55                                          // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }

thread '[mir-opt] mir-opt/uniform_array_move_out.rs' panicked at 'Actual MIR output differs from expected MIR output /checkout/src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir', src/tools/compiletest/src/runtest.rs:3357:25


failures:
    [mir-opt] mir-opt/uniform_array_move_out.rs
    [mir-opt] mir-opt/uniform_array_move_out.rs

test result: FAILED. 162 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out; finished in 3.24s



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" "--suite" "mir-opt" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-12/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "12.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel hellonew hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit orcshared orctargetprocess passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "nightly" "--color" "always"


Build completed unsuccessfully in 0:13:06

@pnkfelix
Copy link
Member

Discussed in T-compiler meeting.

Given that our trajectory is to support oom=panic (PR #88098, Tracking Issue #43596), we do not think we will be landing this.

It was good to gather the performance data, though!

@pnkfelix pnkfelix closed this Nov 19, 2021
@nbdd0121 nbdd0121 deleted the box2 branch November 19, 2021 15:37
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 3, 2022
Remove `NullOp::Box`

Follow up of rust-lang#89030 and MCP rust-lang/compiler-team#460.

~1 month later nothing seems to be broken, apart from a small regression that rust-lang#89332 (1aac85bb716c09304b313d69d30d74fe7e8e1a8e) shows could be regained by remvoing the diverging path, so it shall be safe to continue and remove `NullOp::Box` completely.

r? `@jonas-schievink`
`@rustbot` label T-compiler
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 13, 2022
Remove `NullOp::Box`

Follow up of rust-lang#89030 and MCP rust-lang/compiler-team#460.

~1 month later nothing seems to be broken, apart from a small regression that rust-lang#89332 (1aac85bb716c09304b313d69d30d74fe7e8e1a8e) shows could be regained by remvoing the diverging path, so it shall be safe to continue and remove `NullOp::Box` completely.

r? `@jonas-schievink`
`@rustbot` label T-compiler
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Feb 23, 2022
Remove `NullOp::Box`

Follow up of rust-lang#89030 and MCP rust-lang/compiler-team#460.

~1 month later nothing seems to be broken, apart from a small regression that rust-lang#89332 (1aac85bb716c09304b313d69d30d74fe7e8e1a8e) shows could be regained by remvoing the diverging path, so it shall be safe to continue and remove `NullOp::Box` completely.

r? `@jonas-schievink`
`@rustbot` label T-compiler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet