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

Reduce inlining cost for statement #116708

Closed
wants to merge 4 commits into from
Closed

Conversation

cjgillot
Copy link
Contributor

r? @ghost

@rustbot rustbot added 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. labels Oct 13, 2023
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Oct 13, 2023

⌛ Trying commit 206fb10 with merge 4039d49...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2023
Reduce inlining cost for statement

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 13, 2023

☀️ Try build successful - checks-actions
Build commit: 4039d49 (4039d496a103c16c9818e2796d45d978b2fa9c39)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4039d49): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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 may lead 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-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.1% [0.2%, 7.1%] 67
Regressions ❌
(secondary)
2.1% [0.2%, 8.0%] 19
Improvements ✅
(primary)
-0.9% [-4.6%, -0.1%] 95
Improvements ✅
(secondary)
-1.7% [-11.4%, -0.2%] 71
All ❌✅ (primary) 0.3% [-4.6%, 7.1%] 162

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [0.6%, 12.1%] 94
Regressions ❌
(secondary)
2.9% [0.6%, 8.5%] 26
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-4.7%, -0.6%] 7
All ❌✅ (primary) 3.1% [0.6%, 12.1%] 94

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.9% [1.0%, 6.0%] 27
Regressions ❌
(secondary)
3.5% [1.9%, 7.6%] 12
Improvements ✅
(primary)
-2.7% [-4.3%, -0.8%] 26
Improvements ✅
(secondary)
-6.6% [-10.8%, -1.9%] 16
All ❌✅ (primary) 0.1% [-4.3%, 6.0%] 53

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.6% [0.1%, 23.1%] 76
Regressions ❌
(secondary)
0.8% [0.2%, 8.3%] 73
Improvements ✅
(primary)
-1.3% [-2.2%, -0.0%] 44
Improvements ✅
(secondary)
-1.1% [-2.4%, -0.0%] 16
All ❌✅ (primary) 2.5% [-2.2%, 23.1%] 120

Bootstrap: 628.692s -> 636.288s (1.21%)
Artifact size: 271.29 MiB -> 274.02 MiB (1.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 14, 2023
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

INSTR_COST=2
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Oct 14, 2023

⌛ Trying commit b5e754c with merge 19cfbbf...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2023
Reduce inlining cost for statement

r? `@ghost`
@bors
Copy link
Contributor

bors commented Oct 14, 2023

☀️ Try build successful - checks-actions
Build commit: 19cfbbf (19cfbbf1df9dcb4984ae2949deb683a0f3f11cd4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (19cfbbf): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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 may lead 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-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.7% [0.3%, 5.3%] 62
Regressions ❌
(secondary)
3.2% [0.7%, 7.9%] 10
Improvements ✅
(primary)
-0.7% [-5.2%, -0.1%] 110
Improvements ✅
(secondary)
-1.3% [-9.1%, -0.2%] 84
All ❌✅ (primary) 0.2% [-5.2%, 5.3%] 172

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [0.6%, 21.9%] 65
Regressions ❌
(secondary)
3.0% [1.2%, 8.7%] 15
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
-1.6% [-2.3%, -0.6%] 8
All ❌✅ (primary) 3.1% [-0.6%, 21.9%] 66

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.6% [1.1%, 4.3%] 21
Regressions ❌
(secondary)
3.4% [0.8%, 7.6%] 8
Improvements ✅
(primary)
-2.5% [-4.4%, -0.8%] 13
Improvements ✅
(secondary)
-5.5% [-7.4%, -1.8%] 11
All ❌✅ (primary) 0.6% [-4.4%, 4.3%] 34

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.5% [0.1%, 17.1%] 73
Regressions ❌
(secondary)
1.8% [0.0%, 8.0%] 18
Improvements ✅
(primary)
-0.7% [-1.4%, -0.0%] 35
Improvements ✅
(secondary)
-1.7% [-3.1%, -1.0%] 8
All ❌✅ (primary) 2.1% [-1.4%, 17.1%] 108

Bootstrap: 627.574s -> 638.146s (1.68%)
Artifact size: 271.31 MiB -> 273.28 MiB (0.73%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2023
@cjgillot cjgillot added the A-mir-opt Area: MIR optimizations label Oct 15, 2023
@cjgillot
Copy link
Contributor Author

INSTR_COST=2 with automatic cross-crate inlining
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Oct 18, 2023

⌛ Trying commit b5e754c with merge 470feda...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2023
Reduce inlining cost for statement

r? `@ghost`
@bors
Copy link
Contributor

bors commented Oct 18, 2023

☀️ Try build successful - checks-actions
Build commit: 470feda (470fedacf150f1d5c1c2e535ce9bc4bdac515d9e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (470feda): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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 may lead 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-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.9% [0.2%, 6.0%] 70
Regressions ❌
(secondary)
1.7% [0.2%, 7.5%] 23
Improvements ✅
(primary)
-0.9% [-5.0%, -0.1%] 62
Improvements ✅
(secondary)
-0.8% [-4.6%, -0.1%] 59
All ❌✅ (primary) 0.6% [-5.0%, 6.0%] 132

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.8% [1.0%, 7.7%] 34
Regressions ❌
(secondary)
3.6% [1.6%, 7.3%] 18
Improvements ✅
(primary)
-5.9% [-9.8%, -2.1%] 2
Improvements ✅
(secondary)
-2.7% [-5.9%, -1.0%] 10
All ❌✅ (primary) 3.3% [-9.8%, 7.7%] 36

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.7% [1.1%, 5.8%] 33
Regressions ❌
(secondary)
4.1% [1.7%, 8.4%] 9
Improvements ✅
(primary)
-2.3% [-4.6%, -0.7%] 15
Improvements ✅
(secondary)
-2.5% [-3.7%, -1.3%] 5
All ❌✅ (primary) 1.1% [-4.6%, 5.8%] 48

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.7% [0.1%, 21.1%] 83
Regressions ❌
(secondary)
1.1% [0.1%, 8.4%] 85
Improvements ✅
(primary)
-0.8% [-1.6%, -0.0%] 40
Improvements ✅
(secondary)
-0.8% [-3.0%, -0.0%] 6
All ❌✅ (primary) 2.2% [-1.6%, 21.1%] 123

Bootstrap: 629.235s -> 634.745s (0.88%)
Artifact size: 303.99 MiB -> 305.72 MiB (0.57%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 18, 2023
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 23, 2023

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

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 12, 2024

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

@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 13, 2024
Reduce inlining cost for statement

r? `@ghost`
@bors
Copy link
Contributor

bors commented Jan 13, 2024

⌛ Trying commit 486a7e8 with merge a2ae6fa...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=cjgillot
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_aa172aad-0132-40a5-9ca5-0b0a8985a6e1
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=cheap-stmt
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_aa172aad-0132-40a5-9ca5-0b0a8985a6e1
GITHUB_REF=refs/pull/116708/merge
GITHUB_REF_NAME=116708/merge
GITHUB_REF_PROTECTED=false
---
GITHUB_SERVER_URL=https:
GITHUB_SHA=3b6981bedf82c0a93cc205dc46f57c57a9bb56de
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_aa172aad-0132-40a5-9ca5-0b0a8985a6e1
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_aa172aad-0132-40a5-9ca5-0b0a8985a6e1
GITHUB_TRIGGERING_ACTOR=cjgillot
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/116708/merge
GITHUB_WORKFLOW_SHA=3b6981bedf82c0a93cc205dc46f57c57a9bb56de
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Sat Jan 13 14:49:17 UTC 2024
  network time: Sat, 13 Jan 2024 14:49:17 GMT
  network time: Sat, 13 Jan 2024 14:49:17 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---

running 279 tests
........................................................................................  88/279
..i...............................................................................i..i.i 176/279
.........................................i...i...iii............ii..F.....i............. 264/279

failures:

---- [mir-opt] tests/mir-opt/pre-codegen/loops.rs stdout ----
---- [mir-opt] tests/mir-opt/pre-codegen/loops.rs stdout ----
3 fn vec_move(_1: Vec<impl Sized>) -> () {
4     debug v => _1;
5     let mut _0: ();
-     let mut _47: std::vec::IntoIter<impl Sized>;
-     let mut _48: std::vec::IntoIter<impl Sized>;
-     let mut _49: &mut std::vec::IntoIter<impl Sized>;
-     let mut _58: std::option::Option<impl Sized>;
-     let mut _76: isize;
-     let _78: ();
+     let mut _2: std::vec::IntoIter<impl Sized>;
+     let mut _3: std::vec::IntoIter<impl Sized>;
+     let mut _4: &mut std::vec::IntoIter<impl Sized>;
+     let mut _5: std::option::Option<impl Sized>;
+     let mut _6: isize;
+     let _8: ();
12     scope 1 {
-         debug iter => _48;
-         let _77: impl Sized;
+         debug iter => _3;
+         let _7: impl Sized;
15         scope 2 {
-             debug x => _77;
+             debug x => _7;
Build completed unsuccessfully in 0:13:30
Build completed unsuccessfully in 0:13:30
-         scope 66 (inlined <std::vec::IntoIter<impl Sized> as Iterator>::next) {
-             debug self => _49;
-             let mut _50: *const impl Sized;
-             let mut _51: *const impl Sized;
-             let mut _52: bool;
-             let mut _53: bool;
-             let _54: *const impl Sized;
-             let mut _55: *const impl Sized;
-             let mut _56: *const impl Sized;
-             let mut _57: impl Sized;
-             let mut _59: *const impl Sized;
-             let mut _65: *const impl Sized;
-             let mut _75: impl Sized;
-             scope 67 {
-                 scope 83 (inlined #[track_caller] zeroed::<impl Sized>) {
-                     let _66: ();
-                     let mut _72: std::mem::MaybeUninit<impl Sized>;
-                     scope 84 {
-                         scope 85 (inlined MaybeUninit::<impl Sized>::zeroed) {
-                             let mut _67: std::mem::MaybeUninit<impl Sized>;
-                             let mut _68: &mut std::mem::MaybeUninit<impl Sized>;
-                             let mut _70: *mut impl Sized;
-                             let _71: ();
-                             scope 86 {
-                                 debug u => _67;
-                                 scope 87 {
-                                     scope 89 (inlined MaybeUninit::<impl Sized>::as_mut_ptr) {
-                                         debug self => _68;
-                                         let mut _69: *mut std::mem::MaybeUninit<impl Sized>;
-                                     }
-                                     scope 90 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::write_bytes) {
-                                         debug self => _70;
-                                         debug val => const 0_u8;
-                                         debug count => const 1_usize;
-                                         scope 91 {
-                                             scope 92 (inlined write_bytes::<impl Sized>) {
-                                                 debug dst => _70;
-                                                 debug val => const 0_u8;
-                                                 debug count => const 1_usize;
-                                                 scope 93 {
-                                                     scope 94 (inlined write_bytes::runtime::<impl Sized>) {
-                                                         debug dst => _70;
-                                                         let mut _81: *const impl Sized;
-                                                         scope 95 (inlined intrinsics::is_aligned_and_not_null::<impl Sized>) {
-                                                             debug ptr => _81;
-                                                             scope 96 (inlined std::ptr::const_ptr::<impl *const impl Sized>::is_null) {
-                                                                 debug self => _81;
-                                                                 let mut _82: *const u8;
-                                                                 scope 97 {
-                                                                     scope 98 (inlined std::ptr::const_ptr::<impl *const T>::is_null::runtime_impl) {
-                                                                         debug ptr => _82;
-                                                                         scope 99 (inlined std::ptr::const_ptr::<impl *const u8>::addr) {
-                                                                             debug self => _82;
-                                                                             scope 100 {
-                                                                                 scope 101 (inlined std::ptr::const_ptr::<impl *const u8>::cast::<()>) {
-                                                                                     debug self => _82;
-                                                                             }
-                                                                         }
-                                                                     }
-                                                                 }
-                                                                 }
-                                                             }
-                                                             scope 102 (inlined std::ptr::const_ptr::<impl *const impl Sized>::is_aligned) {
-                                                                 debug self => _81;
-                                                                 scope 103 (inlined align_of::<impl Sized>) {
-                                                             }
-                                                         }
-                                                     }
-                                                 }
-                                                 }
-                                             }
-                                         }
-                                     }
-                                 }
-                             }
-                             scope 88 (inlined MaybeUninit::<impl Sized>::uninit) {
-                         }
-                         }
-                         scope 104 (inlined #[track_caller] MaybeUninit::<impl Sized>::assume_init) {
-                             debug self => _72;
-                             let _73: ();
-                             let mut _74: std::mem::ManuallyDrop<impl Sized>;
-                             scope 105 {
-                                 scope 106 (inlined ManuallyDrop::<impl Sized>::into_inner) {
-                                     debug slot => _74;
-                             }
-                         }
-                     }
-                 }
-                 }
-             }
-             scope 68 {
-                 debug old => _54;
-                 scope 69 {
-                     scope 107 (inlined std::ptr::const_ptr::<impl *const impl Sized>::add) {
-                         debug self => _55;
-                         debug count => const 1_usize;
-                         scope 108 {
-                     }
-                 }
-                 scope 70 {
-                 scope 70 {
-                     scope 109 (inlined std::ptr::read::<impl Sized>) {
-                         debug src => _54;
-                         scope 110 {
-                             scope 111 (inlined std::ptr::read::runtime::<impl Sized>) {
-                                 debug src => _54;
-                                 scope 112 (inlined intrinsics::is_aligned_and_not_null::<impl Sized>) {
-                                     debug ptr => _54;
-                                     scope 113 (inlined std::ptr::const_ptr::<impl *const impl Sized>::is_null) {
-                                         debug self => _54;
-                                         let mut _83: *const u8;
-                                         scope 114 {
-                                             scope 115 (inlined std::ptr::const_ptr::<impl *const T>::is_null::runtime_impl) {
-                                                 debug ptr => _83;
-                                                 scope 116 (inlined std::ptr::const_ptr::<impl *const u8>::addr) {
-                                                     debug self => _83;
-                                                     scope 117 {
-                                                         scope 118 (inlined std::ptr::const_ptr::<impl *const u8>::cast::<()>) {
-                                                             debug self => _83;
-                                                     }
-                                                 }
-                                             }
-                                         }
-                                         }
-                                     }
-                                     scope 119 (inlined std::ptr::const_ptr::<impl *const impl Sized>::is_aligned) {
-                                         debug self => _54;
-                                         scope 120 (inlined align_of::<impl Sized>) {
-                                     }
-                                 }
-                             }
-                         }
-                         }
-                     }
-                 }
-             }
-             scope 71 (inlined std::ptr::const_ptr::<impl *const impl Sized>::wrapping_byte_sub) {
-                 debug self => _59;
-                 debug count => const 1_usize;
-                 let mut _60: *const u8;
-                 let mut _61: *const u8;
-                 scope 72 (inlined std::ptr::const_ptr::<impl *const impl Sized>::cast::<u8>) {
-                     debug self => _59;
-                 }
-                 scope 73 (inlined std::ptr::const_ptr::<impl *const u8>::wrapping_sub) {
-                     debug self => _60;
-                     debug count => const 1_usize;
-                     scope 74 (inlined core::num::<impl isize>::wrapping_neg) {
-                         debug self => const 1_isize;
-                         scope 75 (inlined core::num::<impl isize>::wrapping_sub) {
-                             debug self => const 0_isize;
-                             debug rhs => const 1_isize;
-                     }
-                     }
-                     scope 76 (inlined std::ptr::const_ptr::<impl *const u8>::wrapping_offset) {
-                         debug self => _60;
-                         debug count => const -1_isize;
-                         scope 77 {
-                     }
-                 }
-                 }
-                 scope 78 (inlined std::ptr::const_ptr::<impl *const u8>::with_metadata_of::<impl Sized>) {
-                     debug self => _61;
-                     debug meta => _59;
-                     let mut _62: *const ();
-                     scope 79 (inlined std::ptr::metadata::<impl Sized>) {
-                         debug ptr => _59;
-                         scope 80 {
-                     }
-                     }
-                     scope 81 (inlined std::ptr::from_raw_parts::<impl Sized>) {
-                         debug data_address => _62;
-                         debug metadata => const ();
-                         let mut _63: std::ptr::metadata::PtrComponents<impl Sized>;
-                         let mut _64: std::ptr::metadata::PtrRepr<impl Sized>;
-                         scope 82 {
-                     }
-                 }
-             }
-         }
-         }
200     }
-     scope 3 (inlined <Vec<impl Sized> as IntoIterator>::into_iter) {
-         debug self => _1;
-         let mut _3: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _4: &std::vec::Vec<impl Sized>;
-         let mut _6: *const std::alloc::Global;
-         let mut _7: &mut std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _8: &mut std::vec::Vec<impl Sized>;
-         let mut _18: bool;
-         let mut _19: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _20: &std::vec::Vec<impl Sized>;
-         let mut _21: usize;
-         let mut _22: *mut impl Sized;
-         let mut _23: *const impl Sized;
-         let mut _25: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _26: &std::vec::Vec<impl Sized>;
-         let mut _27: usize;
-         let mut _38: *mut impl Sized;
-         let mut _39: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-         let mut _40: &alloc::raw_vec::RawVec<impl Sized>;
-         let mut _44: std::ptr::NonNull<impl Sized>;
-         let mut _45: usize;
-         let mut _46: *const impl Sized;
-         scope 4 {
-             let mut _2: std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
-             scope 5 {
-                 debug me => _2;
-                 scope 6 {
-                     debug alloc => const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }};
-                     let _17: *mut impl Sized;
-                     scope 7 {
-                         debug begin => _17;
-                         let _24: *const impl Sized;
-                         scope 8 {
-                             debug end => _24;
-                             let _42: usize;
-                             scope 9 {
-                                 debug cap => _42;
-                                 scope 57 (inlined NonNull::<impl Sized>::new_unchecked) {
-                                     debug ptr => _17;
-                                     let mut _43: *const impl Sized;
-                                     scope 58 {
-                                         scope 59 (inlined NonNull::<T>::new_unchecked::runtime::<impl Sized>) {
-                                             debug ptr => _17;
-                                             scope 60 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::is_null) {
-                                                 debug self => _17;
-                                                 let mut _80: *mut u8;
-                                                 scope 61 {
-                                                     scope 62 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
-                                                         debug ptr => _80;
-                                                         scope 63 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
-                                                             debug self => _80;
-                                                             scope 64 {
-                                                                 scope 65 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
-                                                                     debug self => _80;
-                                                             }
-                                                         }
-                                                     }
-                                                 }
-                                                 }
-                                             }
-                                         }
-                                     }
-                                 }
-                             }
-                             scope 55 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                                 debug self => _39;
-                             }
-                             scope 56 (inlined alloc::raw_vec::RawVec::<impl Sized>::capacity) {
-                                 debug self => _40;
-                                 let mut _41: bool;
-                         }
-                         }
-                         scope 39 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                             debug self => _25;
-                         }
-                         scope 40 (inlined Vec::<impl Sized>::len) {
-                             debug self => _26;
-                         }
-                         scope 41 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::wrapping_byte_add) {
-                             debug self => _17;
-                             debug count => _27;
-                             let mut _28: *mut u8;
-                             let mut _32: *mut u8;
-                             let mut _33: *const impl Sized;
-                             scope 42 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::cast::<u8>) {
-                                 debug self => _17;
-                             }
-                             scope 43 (inlined std::ptr::mut_ptr::<impl *mut u8>::wrapping_add) {
-                                 debug self => _28;
-                                 debug count => _27;
-                                 let mut _29: isize;
-                                 scope 44 (inlined std::ptr::mut_ptr::<impl *mut u8>::wrapping_offset) {
-                                     debug self => _28;
-                                     debug count => _29;
-                                     let mut _30: *const u8;
-                                     let mut _31: *const u8;
-                                     scope 45 {
-                                 }
-                             }
-                             }
-                             scope 46 (inlined std::ptr::mut_ptr::<impl *mut u8>::with_metadata_of::<impl Sized>) {
-                                 debug self => _32;
-                                 debug meta => _33;
-                                 let mut _34: *mut ();
-                                 scope 47 (inlined std::ptr::metadata::<impl Sized>) {
-                                     debug ptr => _33;
-                                     scope 48 {
-                                 }
-                                 }
-                                 scope 49 (inlined std::ptr::from_raw_parts_mut::<impl Sized>) {
-                                     debug data_address => _34;
-                                     debug metadata => const ();
-                                     let mut _35: *const ();
-                                     let mut _36: std::ptr::metadata::PtrComponents<impl Sized>;
-                                     let mut _37: std::ptr::metadata::PtrRepr<impl Sized>;
-                                     scope 50 {
-                                 }
-                             }
-                         }
-                         }
-                         scope 51 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                             debug self => _19;
-                         }
-                         scope 52 (inlined Vec::<impl Sized>::len) {
-                             debug self => _20;
-                         }
-                         scope 53 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::add) {
-                             debug self => _17;
-                             debug count => _21;
-                             scope 54 {
-                         }
-                     }
-                     }
-                     scope 27 (inlined <ManuallyDrop<Vec<impl Sized>> as DerefMut>::deref_mut) {
-                         debug self => _7;
-                     }
-                     scope 28 (inlined Vec::<impl Sized>::as_mut_ptr) {
-                         debug self => _8;
-                         let mut _9: &alloc::raw_vec::RawVec<impl Sized>;
-                         scope 29 (inlined alloc::raw_vec::RawVec::<impl Sized>::ptr) {
-                             debug self => _9;
-                             let mut _10: std::ptr::NonNull<impl Sized>;
-                             scope 30 (inlined Unique::<impl Sized>::as_ptr) {
-                                 debug ((self: Unique<impl Sized>).0: std::ptr::NonNull<impl Sized>) => _10;
-                                 debug ((self: Unique<impl Sized>).1: std::marker::PhantomData<impl Sized>) => const ZeroSized: PhantomData<impl Sized>;
-                                 scope 31 (inlined NonNull::<impl Sized>::as_ptr) {
-                                     debug self => _10;
-                                     let mut _11: *const impl Sized;
-                                     let mut _15: bool;
-                                     let mut _16: bool;
-                                     scope 32 {
-                                         scope 33 (inlined std::ptr::const_ptr::<impl *const impl Sized>::is_null) {
-                                             debug self => _11;
-                                             let mut _12: *const u8;
-                                             scope 34 {
-                                                 scope 35 (inlined std::ptr::const_ptr::<impl *const T>::is_null::runtime_impl) {
-                                                     debug ptr => _12;
-                                                     let mut _14: usize;
-                                                     scope 36 (inlined std::ptr::const_ptr::<impl *const u8>::addr) {
-                                                         debug self => _12;
-                                                         let mut _13: *const ();
-                                                         scope 37 {
-                                                             scope 38 (inlined std::ptr::const_ptr::<impl *const u8>::cast::<()>) {
-                                                                 debug self => _12;
-                                                         }
-                                                     }
-                                                 }
-                                             }
-                                             }
-                                         }
-                                     }
-                                 }
-                             }
-                         }
-                     }
-                 }
-                 scope 11 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
-                     debug self => _3;
-                 }
-                 scope 12 (inlined Vec::<impl Sized>::allocator) {
-                     debug self => _4;
-                     let mut _5: &alloc::raw_vec::RawVec<impl Sized>;
-                     scope 13 (inlined alloc::raw_vec::RawVec::<impl Sized>::allocator) {
-                         debug self => _5;
-                 }
-                 }
-                 scope 14 (inlined std::ptr::read::<std::alloc::Global>) {
-                     debug src => _6;
-                     scope 15 {
-                         scope 16 (inlined std::ptr::read::runtime::<std::alloc::Global>) {
-                             debug src => _6;
-                             scope 17 (inlined intrinsics::is_aligned_and_not_null::<std::alloc::Global>) {
-                                 debug ptr => _6;
-                                 scope 18 (inlined std::ptr::const_ptr::<impl *const std::alloc::Global>::is_null) {
-                                     debug self => _6;
-                                     let mut _79: *const u8;
-                                     scope 19 {
-                                         scope 20 (inlined std::ptr::const_ptr::<impl *const T>::is_null::runtime_impl) {
-                                             debug ptr => _79;
-                                             scope 21 (inlined std::ptr::const_ptr::<impl *const u8>::addr) {
-                                                 debug self => _79;
-                                                 scope 22 {
-                                                     scope 23 (inlined std::ptr::const_ptr::<impl *const u8>::cast::<()>) {
-                                                         debug self => _79;
-                                                 }
-                                             }
-                                         }
-                                     }
-                                     }
-                                 }
-                                 scope 24 (inlined std::ptr::const_ptr::<impl *const std::alloc::Global>::is_aligned) {
-                                     debug self => _6;
-                                     scope 25 (inlined align_of::<std::alloc::Global>) {
-                                 }
-                             }
-                         }
-                     }
-                     }
-                 }
-                 scope 26 (inlined ManuallyDrop::<std::alloc::Global>::new) {
-                     debug value => const std::alloc::Global;
-             }
-             }
-             scope 10 (inlined ManuallyDrop::<Vec<impl Sized>>::new) {
-                 debug value => _1;
-         }
-     }
429 
430     bb0: {
430     bb0: {
-         StorageLive(_47);
-         StorageLive(_17);
-         StorageLive(_8);
-         StorageLive(_7);
-         StorageLive(_43);
436         StorageLive(_2);
-         _2 = ManuallyDrop::<Vec<impl Sized>> { value: move _1 };
-         StorageLive(_6);
-         StorageLive(_4);
-         StorageLive(_3);
-         _3 = &_2;
-         _4 = &(_2.0: std::vec::Vec<impl Sized>);
-         StorageDead(_3);
-         StorageLive(_5);
-         _5 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
-         StorageDead(_5);
-         _6 = &raw const (((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).2: std::alloc::Global);
-         StorageDead(_4);
-         StorageLive(_79);
-         StorageDead(_79);
-         StorageDead(_6);
-         _7 = &mut _2;
-         _8 = &mut (_2.0: std::vec::Vec<impl Sized>);
-         StorageLive(_9);
-         _9 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
-         StorageLive(_10);
-         _10 = ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: std::ptr::Unique<impl Sized>).0: std::ptr::NonNull<impl Sized>);
-         StorageLive(_11);
-         StorageLive(_16);
-         StorageLive(_15);
-         _11 = (_10.0: *const impl Sized);
-         StorageLive(_12);
-         _12 = _11 as *const u8 (PtrToPtr);
-         StorageLive(_14);
-         StorageLive(_13);
-         _13 = _12 as *const () (PtrToPtr);
-         _14 = move _13 as usize (Transmute);
-         StorageDead(_13);
-         _15 = Eq(move _14, const 0_usize);
-         StorageDead(_14);
-         StorageDead(_12);
-         _16 = Not(move _15);
-         StorageDead(_15);
-         assume(move _16);
-         StorageDead(_16);
-         _17 = _11 as *mut impl Sized (PtrToPtr);
-         StorageDead(_11);
-         StorageDead(_10);
-         StorageDead(_9);
-         StorageLive(_24);
-         StorageLive(_18);
-         _18 = const _;
---
-         _58 = Option::<impl Sized>::None;
-         goto -> bb18;
-     }
- 
-     bb18: {
-         StorageDead(_52);
-         _76 = discriminant(_58);
-         switchInt(move _76) -> [0: bb19, 1: bb21, otherwise: bb25];
- 
-     bb19: {
-         StorageDead(_58);
-         StorageDead(_58);
-         drop(_48) -> [return: bb20, unwind continue];
- 
-     bb20: {
-         StorageDead(_48);
-         StorageDead(_47);
-         StorageDead(_47);
-         return;
-     }
- 
-     bb21: {
-         _77 = move ((_58 as Some).0: impl Sized);
-         _78 = opaque::<impl Sized>(move _77) -> [return: bb22, unwind: bb23];
- 
-     bb22: {
-         StorageDead(_58);
-         goto -> bb8;
-         goto -> bb8;
-     }
- 
-     bb23 (cleanup): {
-         drop(_48) -> [return: bb24, unwind terminate(cleanup)];
- 
- 
-     bb24 (cleanup): {
+     bb10 (cleanup): {
756         resume;
- 
-     bb25: {
-         unreachable;
761     }
761     }
762 }
763 

thread '[mir-opt] tests/mir-opt/pre-codegen/loops.rs' panicked at src/tools/compiletest/src/runtest.rs:4130:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir


failures:
    [mir-opt] tests/mir-opt/pre-codegen/loops.rs

@bors
Copy link
Contributor

bors commented Jan 13, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a2ae6fa): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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 may lead 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-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.1% [0.2%, 11.5%] 115
Regressions ❌
(secondary)
1.7% [0.2%, 13.0%] 43
Improvements ✅
(primary)
-1.4% [-4.7%, -0.1%] 38
Improvements ✅
(secondary)
-1.3% [-4.2%, -0.2%] 51
All ❌✅ (primary) 1.3% [-4.7%, 11.5%] 153

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.3% [0.6%, 22.0%] 83
Regressions ❌
(secondary)
3.0% [0.9%, 8.1%] 26
Improvements ✅
(primary)
-11.2% [-11.2%, -11.2%] 1
Improvements ✅
(secondary)
-4.2% [-5.1%, -3.6%] 3
All ❌✅ (primary) 3.2% [-11.2%, 22.0%] 84

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.5% [1.3%, 11.3%] 43
Regressions ❌
(secondary)
3.9% [1.5%, 12.6%] 15
Improvements ✅
(primary)
-2.8% [-4.3%, -1.3%] 12
Improvements ✅
(secondary)
-2.7% [-3.9%, -1.6%] 7
All ❌✅ (primary) 2.2% [-4.3%, 11.3%] 55

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 669.206s -> 678.534s (1.39%)
Artifact size: 308.17 MiB -> 312.27 MiB (1.33%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 13, 2024
@cjgillot cjgillot closed this Apr 7, 2024
@cjgillot cjgillot deleted the cheap-stmt branch April 7, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations 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.

5 participants