rust icon indicating copy to clipboard operation
rust copied to clipboard

Avoid lowering code under dead SwitchInt targets

Open saethlin opened this issue 1 year ago • 52 comments

The objective of this PR is to detect and eliminate code which is guarded by an if false, even if that false is a constant which is not known until monomorphization, or is intrinsics::debug_assertions().

The effect of this is that we generate no LLVM IR the standard library's unsafe preconditions, when they are compiled in a build where they should be immediately optimized out. This mono-time optimization ensures that builds which disable debug assertions do not grow a linkage requirement against core, which compiler-builtins currently needs: https://github.com/rust-lang/rust/issues/121552

This revives the codegen side of https://github.com/rust-lang/rust/pull/91222 as planned in https://github.com/rust-lang/rust/issues/120848.

saethlin avatar Feb 22 '24 00:02 saethlin

@bors try @rust-timer queue

saethlin avatar Feb 22 '24 00:02 saethlin

Awaiting bors try build completion.

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

rust-timer avatar Feb 22 '24 00:02 rust-timer

:hourglass: Trying commit 2dcf095d5f6b54a2595fd85036c19aa7db004aab with merge 3f638e017a6e2da26b9b57f4115a699c58c6ecf8...

bors avatar Feb 22 '24 00:02 bors

The job mingw-check-tidy failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v4' (SHA:b4ffde65f46336ab88eb53be808477a3936bae11)
Download action repository 'actions/upload-artifact@v3' (SHA:a8a3f3ad30e3422c9c7b888a15615d19a852ae32)
Complete job name: PR - mingw-check-tidy
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_d674d50b-a844-4684-b9c4-1ee4954044aa
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=smarter-mono
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_d674d50b-a844-4684-b9c4-1ee4954044aa
GITHUB_REF=refs/pull/121421/merge
GITHUB_REF_NAME=121421/merge
GITHUB_REF_PROTECTED=false
---
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt \
    && pip3 install virtualenv
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
           --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---

#10 [5/8] COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
#10 DONE 0.0s

#11 [6/8] RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt     && pip3 install virtualenv
#11 0.644   Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
#11 0.656 Collecting boolean-py==4.0
#11 0.660   Downloading boolean.py-4.0-py3-none-any.whl (25 kB)
#11 0.673 Collecting chardet==5.1.0
---
#11 3.787 Building wheels for collected packages: reuse
#11 3.788   Building wheel for reuse (pyproject.toml): started
#11 4.132   Building wheel for reuse (pyproject.toml): finished with status 'done'
#11 4.133   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#11 4.133   Stored in directory: /tmp/pip-ephem-wheel-cache-96kwmk4d/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#11 4.136 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#11 4.158   Attempting uninstall: setuptools
#11 4.159     Found existing installation: setuptools 59.6.0
#11 4.160     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#11 4.160     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#11 4.160     Can't uninstall 'setuptools'. No files were found to uninstall.
#11 4.841 Successfully installed binaryornot-0.4.4 boolean-py-4.0 chardet-5.1.0 jinja2-3.1.2 license-expression-30.0.0 markupsafe-2.1.1 python-debian-0.1.49 reuse-1.1.0 setuptools-66.0.0
#11 4.841 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#11 5.356 Collecting virtualenv
#11 5.395   Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
#11 5.460      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 60.3 MB/s eta 0:00:00
#11 5.497 Collecting distlib<1,>=0.3.7
#11 5.501   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#11 5.508      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 109.8 MB/s eta 0:00:00
#11 5.536 Collecting platformdirs<5,>=3.9.1
#11 5.540   Downloading platformdirs-4.2.0-py3-none-any.whl (17 kB)
#11 5.572 Collecting filelock<4,>=3.12.2
#11 5.576   Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
#11 5.662 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#11 5.827 Successfully installed distlib-0.3.8 filelock-3.13.1 platformdirs-4.2.0 virtualenv-20.25.0
#11 DONE 5.9s

#12 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#12 DONE 0.0s
---
DirectMap4k:      174016 kB
DirectMap2M:     7165952 kB
DirectMap1G:    11534336 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test            --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
    Finished dev [unoptimized] target(s) in 0.03s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/3406ada96f8e16e49e947a91db3eba0db45245fa/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-3406ada96f8e16e49e947a91db3eba0db45245fa-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
##[endgroup]
fmt check
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_codegen_ssa/src/mir/mod.rs:271: \
Use a single space after dots in comments.
##[error]tidy error: /checkout/compiler/rustc_middle/src/mir/mod.rs:650: \
Use a single space after dots in comments.
##[error]tidy error: /checkout/compiler/rustc_middle/src/mir/mod.rs:669: \
Use a single space after dots in comments.
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (23.3.1)
Collecting pip
  Downloading pip-24.0-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.0-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.3.1
    Uninstalling pip-23.3.1:
    Uninstalling pip-23.3.1:
      Successfully uninstalled pip-23.3.1
Successfully installed pip-24.0
Collecting black==23.3.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 7))
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 29.5 MB/s eta 0:00:00
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 29.5 MB/s eta 0:00:00
Collecting click==8.1.3 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 34))
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
Collecting importlib-metadata==6.7.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 38))
  Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
  Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Collecting mypy-extensions==1.0.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 42))
  Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Collecting packaging==23.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 46))
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
Collecting pathspec==0.11.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 50))
  Downloading pathspec-0.11.1-py3-none-any.whl (29 kB)
  Downloading pathspec-0.11.1-py3-none-any.whl (29 kB)
Collecting platformdirs==3.6.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 54))
  Downloading platformdirs-3.6.0-py3-none-any.whl (16 kB)
Collecting ruff==0.0.272 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 58))
  Downloading ruff-0.0.272-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB)
Collecting tomli==2.0.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 77))
  Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting typed-ast==1.5.4 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 81))
  Downloading typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (877 kB)
  Downloading typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (877 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 877.7/877.7 kB 124.0 MB/s eta 0:00:00
Collecting typing-extensions==4.6.3 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 107))
  Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting zipp==3.15.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 114))
  Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
Installing collected packages: zipp, typing-extensions, typed-ast, tomli, ruff, platformdirs, pathspec, packaging, mypy-extensions, click, importlib-metadata, black
Successfully installed black-23.3.0 click-8.1.3 importlib-metadata-6.7.0 mypy-extensions-1.0.0 packaging-23.1 pathspec-0.11.1 platformdirs-3.6.0 ruff-0.0.272 tomli-2.0.1 typed-ast-1.5.4 typing-extensions-4.6.3 zipp-3.15.0
some tidy checks failed
Build completed unsuccessfully in 0:01:06
  local time: Thu Feb 22 00:18:44 UTC 2024
  network time: Thu, 22 Feb 2024 00:18:44 GMT

rust-log-analyzer avatar Feb 22 '24 00:02 rust-log-analyzer

The job dist-x86_64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Caused by:
    Command RUST_BACKTRACE=full python3 /checkout/x.py build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std --rust-profile-generate /tmp/tmp-multistage/opt-artifacts/rustc-pgo --set llvm.thin-lto=false --set llvm.link-shared=true [at /checkout/obj] has failed with exit code Some(1)

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
             at /rust/deps/anyhow-1.0.79/src/error.rs:83:36
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/exec.rs:78:17
   2: <opt_dist::exec::Bootstrap>::run
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/exec.rs:179:9
   3: opt_dist::execute_pipeline::{closure#1}::{closure#0}
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/main.rs:210:13
   4: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}::{closure#0}, ()>
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/timer.rs:111:22
   5: opt_dist::execute_pipeline::{closure#1}
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/main.rs:199:9
   6: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/timer.rs:111:22
   7: opt_dist::execute_pipeline
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/main.rs:196:29
             at /rustc/3f638e017a6e2da26b9b57f4115a699c58c6ecf8/src/tools/opt-dist/src/main.rs:385:18
   9: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/core/src/ops/function.rs:250:5
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/sys_common/backtrace.rs:155:18
  11: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/rt.rs:166:18
  12: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
  13: std::panicking::try::do_call
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/panicking.rs:554:40
  14: std::panicking::try
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/panicking.rs:518:19

rust-log-analyzer avatar Feb 22 '24 00:02 rust-log-analyzer

:broken_heart: Test failed - checks-actions

bors avatar Feb 22 '24 00:02 bors

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

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6e0c7e01-fd84-43a0-93b7-9699a69e1f5e
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=smarter-mono
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6e0c7e01-fd84-43a0-93b7-9699a69e1f5e
GITHUB_REF=refs/pull/121421/merge
GITHUB_REF_NAME=121421/merge
GITHUB_REF_PROTECTED=false

rust-log-analyzer avatar Feb 22 '24 00:02 rust-log-analyzer

@bors try @rust-timer queue

saethlin avatar Feb 22 '24 01:02 saethlin

Awaiting bors try build completion.

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

rust-timer avatar Feb 22 '24 01:02 rust-timer

:hourglass: Trying commit 6b3d1526194821084789727b784e3e91fbca2393 with merge b39e4ca89e796c8dc79a5ee1908c82dd174701a6...

bors avatar Feb 22 '24 01:02 bors

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_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_80b29d1e-5aee-45e5-b5c1-7481f0c69fd4
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=smarter-mono
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_80b29d1e-5aee-45e5-b5c1-7481f0c69fd4
GITHUB_REF=refs/pull/121421/merge
GITHUB_REF_NAME=121421/merge
GITHUB_REF_PROTECTED=false
---
#12 writing image sha256:c6433f8f78bec7f982dea3b48ebc0df7f4786731b8c3ebd7506b9909a21ff3e3 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[endgroup]
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: Thu Feb 22 01:02:44 UTC 2024
  network time: Thu, 22 Feb 2024 01:02:44 GMT
  network time: Thu, 22 Feb 2024 01:02:44 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

rust-log-analyzer avatar Feb 22 '24 01:02 rust-log-analyzer

The job dist-x86_64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Caused by:
    Command RUST_BACKTRACE=full python3 /checkout/x.py build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std --rust-profile-generate /tmp/tmp-multistage/opt-artifacts/rustc-pgo --set llvm.thin-lto=false --set llvm.link-shared=true [at /checkout/obj] has failed with exit code Some(1)

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
             at /rust/deps/anyhow-1.0.79/src/error.rs:83:36
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/exec.rs:78:17
   2: <opt_dist::exec::Bootstrap>::run
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/exec.rs:179:9
   3: opt_dist::execute_pipeline::{closure#1}::{closure#0}
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/main.rs:210:13
   4: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}::{closure#0}, ()>
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/timer.rs:111:22
   5: opt_dist::execute_pipeline::{closure#1}
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/main.rs:199:9
   6: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/timer.rs:111:22
   7: opt_dist::execute_pipeline
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/main.rs:196:29
             at /rustc/b39e4ca89e796c8dc79a5ee1908c82dd174701a6/src/tools/opt-dist/src/main.rs:385:18
   9: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/core/src/ops/function.rs:250:5
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/sys_common/backtrace.rs:155:18
  11: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/rt.rs:166:18
  12: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
  13: std::panicking::try::do_call
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/panicking.rs:554:40
  14: std::panicking::try
             at /rustc/04ba4521971a83d71477a406b5ce7a479e9d7af8/library/std/src/panicking.rs:518:19

rust-log-analyzer avatar Feb 22 '24 01:02 rust-log-analyzer

:broken_heart: Test failed - checks-actions

bors avatar Feb 22 '24 01:02 bors

@bors try @rust-timer queue

saethlin avatar Feb 22 '24 03:02 saethlin

Awaiting bors try build completion.

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

rust-timer avatar Feb 22 '24 03:02 rust-timer

:hourglass: Trying commit 127cb4525aa50c3802a0ad4ccb2e1ac5300cda4b with merge b183b7a248fcc8f8102bd2d19782bea9de6e3546...

bors avatar Feb 22 '24 03:02 bors

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_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_2f0bf7c9-bec5-4919-a7f4-19a7f7d4cee8
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=smarter-mono
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_2f0bf7c9-bec5-4919-a7f4-19a7f7d4cee8
GITHUB_REF=refs/pull/121421/merge
GITHUB_REF_NAME=121421/merge
GITHUB_REF_PROTECTED=false
---
#12 writing image sha256:b9939fef84d9060144bd2e389fdd91b3ea395e129cc3cdc1229ba798d1594f33 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[endgroup]
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: Thu Feb 22 03:32:41 UTC 2024
  network time: Thu, 22 Feb 2024 03:32:41 GMT
  network time: Thu, 22 Feb 2024 03:32:41 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
---
##[endgroup]
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
    Finished release [optimized] target(s) in 1.28s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --no-default-features --mini-tests --std-tests`
Using system GCC
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
---- compiler/rustc_mir_transform/src/simplify_if_const.rs - simplify_if_const::SimplifyIfConst (line 7) stdout ----
error: unexpected token: `...`
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:8:12
  |
3 | _1 = Const(...);
  |
help: use `..` for an exclusive range
  |
  |
3 | _1 = Const(..);
help: or `..=` for an inclusive range
  |
  |
3 | _1 = Const(..=);

error[E0586]: inclusive range with no end
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:8:12
  |
  |
3 | _1 = Const(...);
  |
  |
  = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)

error: expected one of `async`, `|`, or `||`, found `_1`
  |
  |
4 | switchInt (move _1)
  |                 ^^ expected one of `async`, `|`, or `||`
error[E0425]: cannot find value `_1` in this scope
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:8:1
  |
  |
3 | _1 = Const(...);
  |
help: you might have meant to introduce a new binding
  |
3 | let _1 = Const(...);
3 | let _1 = Const(...);
  | +++

error[E0425]: cannot find function, tuple struct or tuple variant `Const` in this scope
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:8:6
  |
3 | _1 = Const(...);
  |
help: consider importing one of these items
  |
2 + use rustc_ast::AssocItemKind::Const;
---
---- compiler/rustc_mir_transform/src/simplify_if_const.rs - simplify_if_const::SimplifyIfConst (line 12) stdout ----
error: unexpected token: `...`
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:13:18
  |
3 | switchInt (Const(...))
  |
help: use `..` for an exclusive range
  |
3 | switchInt (Const(..))
3 | switchInt (Const(..))
  |                  ~~
help: or `..=` for an inclusive range
  |
3 | switchInt (Const(..=))

error[E0586]: inclusive range with no end
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:13:18
  |
  |
3 | switchInt (Const(...))
  |
  |
  = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0425]: cannot find function, tuple struct or tuple variant `Const` in this scope
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:13:12
  |
  |
3 | switchInt (Const(...))
  |
help: consider importing one of these items
  |
2 + use rustc_ast::AssocItemKind::Const;
---

error[E0425]: cannot find function `switchInt` in this scope
##[error] --> compiler/rustc_mir_transform/src/simplify_if_const.rs:13:1
  |
3 | switchInt (Const(...))

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0425, E0586.
---
    compiler/rustc_mir_transform/src/simplify_if_const.rs - simplify_if_const::SimplifyIfConst (line 12)

test result: FAILED. 4 passed; 2 failed; 15 ignored; 0 measured; 0 filtered out; finished in 194.75ms

error: doctest failed, to rerun pass `-p rustc_mir_transform --doc`
  local time: Thu Feb 22 04:00:40 UTC 2024
  network time: Thu, 22 Feb 2024 04:00:41 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

rust-log-analyzer avatar Feb 22 '24 04:02 rust-log-analyzer

:sunny: Try build successful - checks-actions Build commit: b183b7a248fcc8f8102bd2d19782bea9de6e3546 (b183b7a248fcc8f8102bd2d19782bea9de6e3546)

bors avatar Feb 22 '24 05:02 bors

Queued b183b7a248fcc8f8102bd2d19782bea9de6e3546 with parent d8b00690ec3aa2d2fb0d3eb00e862195501186f9, future comparison URL. There is currently 1 preceding artifact in the queue. It will probably take at least ~1.3 hours until the benchmark run finishes.

rust-timer avatar Feb 22 '24 05:02 rust-timer

Finished benchmarking commit (b183b7a248fcc8f8102bd2d19782bea9de6e3546): comparison URL.

Overall result: ✅ improvements - no 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.

@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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.1%, -0.2%] 8
Improvements ✅
(secondary)
-0.5% [-0.5%, -0.5%] 1
All ❌✅ (primary) -0.6% [-1.1%, -0.2%] 8

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)
4.5% [3.1%, 7.1%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.2% [-12.6%, -0.4%] 8
Improvements ✅
(secondary)
-3.2% [-3.9%, -2.0%] 3
All ❌✅ (primary) -0.9% [-12.6%, 7.1%] 13

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
-1.3% [-1.6%, -1.2%] 3
All ❌✅ (primary) -0.9% [-0.9%, -0.9%] 1

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)
0.4% [0.1%, 1.6%] 5
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 3
Improvements ✅
(primary)
-0.5% [-1.3%, -0.0%] 71
Improvements ✅
(secondary)
-0.3% [-0.7%, -0.0%] 6
All ❌✅ (primary) -0.4% [-1.3%, 1.6%] 76

Bootstrap: 649.976s -> 648.256s (-0.26%) Artifact size: 310.93 MiB -> 310.95 MiB (0.00%)

rust-timer avatar Feb 22 '24 06:02 rust-timer

@bors try @rust-timer queue

saethlin avatar Feb 24 '24 20:02 saethlin

Awaiting bors try build completion.

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

rust-timer avatar Feb 24 '24 20:02 rust-timer

:hourglass: Trying commit e40fdc7257c7d275af3054255479609eeb25d48a with merge 34110c87fefcdbef3a487a27d5e47a80157a3822...

bors avatar Feb 24 '24 20:02 bors

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_3097798a-7b51-421b-9026-8e26e541ad43
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=smarter-mono
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_3097798a-7b51-421b-9026-8e26e541ad43
GITHUB_REF=refs/pull/121421/merge
GITHUB_REF_NAME=121421/merge
GITHUB_REF_PROTECTED=false
---
    Checking rustc_symbol_mangling v0.0.0 (/checkout/compiler/rustc_symbol_mangling)
error: unresolved link to `std::intrinsics::debug_assertions`
   --> compiler/rustc_middle/src/mir/mod.rs:658:51
    |
658 |     /// of `if <T as Trait>::CONST`, as well as [`std::intrinsics::debug_assertions`].
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `debug_assertions` in module `intrinsics`
    = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

error: could not document `rustc_middle`
error: could not document `rustc_middle`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2021 --crate-type lib --crate-name rustc_middle compiler/rustc_middle/src/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/doc --cfg 'feature="rustc-rayon"' --cfg 'feature="rustc-rayon-core"' --cfg 'feature="rustc_use_parallel_compiler"' -Zunstable-options --check-cfg 'cfg(feature, values("rustc-rayon", "rustc-rayon-core", "rustc_use_parallel_compiler"))' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=7f01bb7c2fb1ae78 -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 bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-91e6bd803f10a75a.rmeta --extern derive_more=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libderive_more-9efdd28671c5b92e.so --extern either=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libeither-2a91dbb1c781de98.rmeta --extern field_offset=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libfield_offset-f0a91431f0df82f6.rmeta --extern gsgdt=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgsgdt-5efca8794245a110.rmeta --extern measureme=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libmeasureme-2566dbce81f0b440.rmeta --extern polonius_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-21c3c010396a6538.rmeta --extern rayon=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librayon-bcb3fb05f42bf8aa.rmeta --extern rayon_core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librayon_core-722e28b3cda65b74.rmeta --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-acdb7438791a1354.rmeta --extern rustc_arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_arena-4482f014cf87dff6.rmeta --extern rustc_ast=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_ast-5e0e71d08d9290fd.rmeta --extern rustc_attr=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_attr-9d28d6d3faed3618.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-d31de55e71c39494.rmeta --extern rustc_error_messages=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_error_messages-7f16b5cc9e775cba.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-784552bb06df02b2.rmeta --extern rustc_feature=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_feature-5d2c8ac6f0d7f305.rmeta --extern rustc_fluent_macro=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/librustc_fluent_macro-fe3541ce532d5a46.so --extern rustc_graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_graphviz-1946d93325a1f16b.rmeta --extern rustc_hir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_hir-5b1556835a951b27.rmeta --extern rustc_index=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_index-9072a0c9c38984bd.rmeta --extern rustc_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/librustc_macros-657bde1f4a8bb06b.so --extern rustc_query_system=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_query_system-ba959331ee3db5a8.rmeta --extern rustc_serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_serialize-d09f023f41c65cc1.rmeta --extern rustc_session=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_session-71914f6d1c9f439f.rmeta --extern rustc_span=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-38d5fe1c5a028c70.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-c5b1c52417d0b44f.rmeta --extern rustc_type_ir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_type_ir-384634a5dedf106c.rmeta --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-17d63ea25df2dc47.rmeta --extern thin_vec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libthin_vec-64cd68e8a890cf38.rmeta --extern tracing=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing-2cfab5196b215b73.rmeta --extern-html-root-url 'bitflags=https://docs.rs/bitflags/2.4.2/' --extern-html-root-url 'derive_more=https://docs.rs/derive_more/0.99.17/' --extern-html-root-url 'either=https://docs.rs/either/1.10.0/' --extern-html-root-url 'field_offset=https://docs.rs/field-offset/0.3.6/' --extern-html-root-url 'gsgdt=https://docs.rs/gsgdt/0.1.2/' --extern-html-root-url 'measureme=https://docs.rs/measureme/11.0.1/' --extern-html-root-url 'polonius_engine=https://docs.rs/polonius-engine/0.13.0/' --extern-html-root-url 'rayon=https://docs.rs/rustc-rayon/0.5.0/' --extern-html-root-url 'rayon_core=https://docs.rs/rustc-rayon-core/0.5.0/' --extern-html-root-url 'rustc_apfloat=https://docs.rs/rustc_apfloat/0.2.0+llvm-462a31f5a5ab/' --extern-html-root-url 'smallvec=https://docs.rs/smallvec/1.13.1/' --extern-html-root-url 'thin_vec=https://docs.rs/thin-vec/0.2.13/' --extern-html-root-url 'tracing=https://docs.rs/tracing/0.1.37/' -Zunstable-options --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(parallel_compiler)' '--check-cfg=cfg(no_btreemap_remove_entry)' '--check-cfg=cfg(crossbeam_loom)' '--check-cfg=cfg(span_locations)' '--check-cfg=cfg(rustix_use_libc)' '--check-cfg=cfg(emulate_second_only_system)' '--check-cfg=cfg(windows_raw_dylib)' --document-private-items --document-hidden-items -Dwarnings '-Wrustdoc::invalid_codeblock_attributes' --crate-version '1.78.0-nightly (3601b9dcb 2024-02-24)' --document-private-items '-Arustdoc::private-intra-doc-links' --enable-index-page -Zunstable-options -Znormalize-docs --show-type-layout --generate-link-to-definition '-Zcrate-attr=warn(rust_2018_idioms)' --cfg=parallel_compiler --extern-html-root-url 'ena=https://docs.rs/ena/latest/'` (exit status: 1)
Build completed unsuccessfully in 0:00:41
  local time: Sat Feb 24 20:22:11 UTC 2024
  network time: Sat, 24 Feb 2024 20:22:11 GMT
##[error]Process completed with exit code 1.

rust-log-analyzer avatar Feb 24 '24 20:02 rust-log-analyzer

:sunny: Try build successful - checks-actions Build commit: 34110c87fefcdbef3a487a27d5e47a80157a3822 (34110c87fefcdbef3a487a27d5e47a80157a3822)

bors avatar Feb 24 '24 21:02 bors

Queued 34110c87fefcdbef3a487a27d5e47a80157a3822 with parent 8f359beca4e58bc3ae795a666301a8f47023044c, future comparison URL. There is currently 1 preceding artifact in the queue. It will probably take at least ~1.8 hours until the benchmark run finishes.

rust-timer avatar Feb 24 '24 21:02 rust-timer

Finished benchmarking commit (34110c87fefcdbef3a487a27d5e47a80157a3822): 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.6% [0.3%, 2.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-1.2%, -0.4%] 9
Improvements ✅
(secondary)
-1.1% [-1.1%, -1.1%] 1
All ❌✅ (primary) -0.3% [-1.2%, 2.8%] 11

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-2.2%, -0.5%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.4% [-2.2%, -0.5%] 2

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.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-5.6%, -0.9%] 4
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 1

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.9% [-2.0%, -0.1%] 65
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.0%] 18
All ❌✅ (primary) -0.9% [-2.0%, -0.1%] 65

Bootstrap: 648.482s -> 650.363s (0.29%) Artifact size: 310.98 MiB -> 311.04 MiB (0.02%)

rust-timer avatar Feb 24 '24 23:02 rust-timer

r? compiler

saethlin avatar Feb 25 '24 01:02 saethlin

I reviewed the above perf report and I have no theories on why any of the builds got slower. The optimization added here leaves behind some blocks which are just an unreachable terminator, which perhaps may be inducing some extra work for LLVM. But those unreachable blocks are also trivially dead code, they're only reached by the not-taken target of a br i1 false terminator.

It is possible that those regressions will be recouped by https://github.com/rust-lang/rust/pull/120650 because that PR will turn those just-an-unreachable blocks into blocks without predecessors.

But I also don't think this miniscule regression is much worth thinking about. The transform here is pure code deletion, and eases development of compiler-builtins.


Also, the second perf run includes handling intrinsics::debug_assertions, the first one does not. Handling the intrinsic doesn't help performance much because the case where it's most impactful is optimizations off, and debug assertions off. We don't benchmark that configuration. In debug builds intrinsics::debug_assertions can't be cleaned up at all, and in release builds I've already done a lot of work to keep the compile-time overhead down.

Where this strategy does help is @scottmcm's original objective: code like in vec's IntoIter and slice iterators which select between implementations internally based on a generic associated const. In debug builds we get to about halve the IR for all slice iterator functions.

saethlin avatar Feb 25 '24 02:02 saethlin

Perf queue is quiet, and https://github.com/rust-lang/rust/pull/120650 landed. So let's go again! @bors try @rust-timer queue

saethlin avatar Feb 25 '24 05:02 saethlin