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

Fold pointer operations in GVN #120405

Merged
merged 7 commits into from
Feb 11, 2024
Merged

Fold pointer operations in GVN #120405

merged 7 commits into from
Feb 11, 2024

Conversation

cjgillot
Copy link
Contributor

This PR proposes 2 combinations of cast operations in MIR GVN:

  • a chain of PtrToPtr or MutToConstPointer casts can be folded together into a single PtrToPtr cast;
  • we attempt to evaluate more ptr ops when there is no provenance.

In particular, this allows to read from static slices.

This is not yet sufficient to see through slice operations that use PtrComponents (because that's a union), but still a step forward.

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 Jan 27, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2024

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot cjgillot marked this pull request as draft January 27, 2024 01:37
@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 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2024
Fold pointer operations in GVN

This PR proposes 2 combinations of cast operations in MIR GVN:
- a chain of `PtrToPtr` or `MutToConstPointer` casts can be folded together into a single `PtrToPtr` cast;
- we attempt to evaluate more ptr ops when there is no provenance.

In particular, this allows to read from static slices.

This is not yet sufficient to see through slice operations that use `PtrComponents` (because that's a union), but still a step forward.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Jan 27, 2024

⌛ Trying commit 9acd497 with merge bf3fe6c...

@bors
Copy link
Contributor

bors commented Jan 27, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bf3fe6c): 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)
0.7% [0.3%, 1.5%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-1.4%, -0.5%] 3
Improvements ✅
(secondary)
-0.9% [-1.4%, -0.6%] 5
All ❌✅ (primary) 0.1% [-1.4%, 1.5%] 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)
3.5% [0.2%, 7.8%] 6
Regressions ❌
(secondary)
3.7% [2.2%, 5.2%] 4
Improvements ✅
(primary)
-4.4% [-7.2%, -1.5%] 6
Improvements ✅
(secondary)
-3.2% [-4.2%, -1.8%] 5
All ❌✅ (primary) -0.4% [-7.2%, 7.8%] 12

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)
1.7% [0.9%, 2.8%] 6
Regressions ❌
(secondary)
3.8% [2.1%, 5.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) 1.7% [0.9%, 2.8%] 6

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.0%, 3.6%] 62
Regressions ❌
(secondary)
0.2% [0.1%, 1.4%] 37
Improvements ✅
(primary)
-0.2% [-0.4%, -0.1%] 18
Improvements ✅
(secondary)
-0.5% [-2.0%, -0.2%] 10
All ❌✅ (primary) 0.2% [-0.4%, 3.6%] 80

Bootstrap: 659.743s -> 662.688s (0.45%)
Artifact size: 308.15 MiB -> 308.23 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 27, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jan 27, 2024

-18% instructions and -27.5% cycles on the nom-json runtime benchmark, which parses JSON using nom! 🎉

Looks like it was able to see through more stuff and optimize better:

< -265,860,877  /home/ber0134/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nom-7.1.3/src/internal.rs:
  -265,373,071    <F as nom::internal::Parser<I,O,E>>::parse
      -487,806    <(A,B) as nom::branch::Alt<Input,Output,Error>>::choice

< -156,132,004  /home/ber0134/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nom-7.1.3/src/multi/mod.rs:<F as nom::internal::Parser<I,O,E>>::parse

<   51,394,701  /home/ber0134/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nom-7.1.3/src/character/complete.rs:
    52,172,911    <F as nom::internal::Parser<I,O,E>>::parse
      -778,210    <(A,B) as nom::branch::Alt<Input,Output,Error>>::choice

<  -18,319,000  library/core/src/char/methods.rs:<F as nom::internal::Parser<I,O,E>>::parse

<  -17,268,511  library/core/src/option.rs:
   -17,268,600    <F as nom::internal::Parser<I,O,E>>::parse

<  -16,117,700  /projects/personal/rust/rustc-perf/collector/runtime-benchmarks/parsing/src/json.rs:<F as nom::internal::Parser<I,O,E>>::parse

@cjgillot cjgillot marked this pull request as ready for review January 27, 2024 13:54
@cjgillot
Copy link
Contributor Author

r? @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Jan 29, 2024

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jan 29, 2024

📌 Commit efc5814 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2024
Fold pointer operations in GVN

This PR proposes 2 combinations of cast operations in MIR GVN:
- a chain of `PtrToPtr` or `MutToConstPointer` casts can be folded together into a single `PtrToPtr` cast;
- we attempt to evaluate more ptr ops when there is no provenance.

In particular, this allows to read from static slices.

This is not yet sufficient to see through slice operations that use `PtrComponents` (because that's a union), but still a step forward.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Jan 30, 2024

⌛ Testing commit efc5814 with merge 9efcef9...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 30, 2024

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 30, 2024
@bors
Copy link
Contributor

bors commented Feb 10, 2024

⌛ Testing commit 7a6b00e with merge 5225cd8...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2024
Fold pointer operations in GVN

This PR proposes 2 combinations of cast operations in MIR GVN:
- a chain of `PtrToPtr` or `MutToConstPointer` casts can be folded together into a single `PtrToPtr` cast;
- we attempt to evaluate more ptr ops when there is no provenance.

In particular, this allows to read from static slices.

This is not yet sufficient to see through slice operations that use `PtrComponents` (because that's a union), but still a step forward.

r? `@ghost`
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
##[group][AOT] issue-72793
[AOT] issue-72793
error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/bin:/usr/local/lib/ruby/gems/3.0.0/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "x86_64" "-m64" "/var/folders/r0/ztvld9wd66bfpv_g6h3ksl000000gn/T/rustc3tLRId/symbols.o" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793.issue_72793.10afbbda08d31bcd-cgu.0.rcgu.o" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793.allocator_shim.rcgu.o" "-L" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example" "-L" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libstd-a7ffcf8feb5de0df.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libpanic_abort-f72dbe40e56cf4e9.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libobject-93683961e4fe014c.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-608f39623da2acc6.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-2b17e3e98a369b70.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libgimli-98e18d571f0d3c98.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-105905fe6fc6bf57.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-c72f1c866e7081dc.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-e82114027f985b88.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-f99fcd695211a1c9.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-9bba2c1110da01a8.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libadler-f86ef4dff75dd50c.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libunwind-0b11117ce25a1560.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-3fce4a1c07607df0.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/liblibc-e38fe75b4b440008.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2b3dd1868cffbb25.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-0171fe66a8ec9014.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libcore-939f78aa140a5d6b.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-83f97429b7f69221.rlib" "-lSystem" "-lc" "-lm" "-L" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793" "-Wl,-dead_strip" "-nodefaultlibs" "-Wl,-rpath,@loader_path/../lib" "-undefined" "dynamic_lookup"
  = note: ld: invalid r_symbolnum=14 in '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793.issue_72793.10afbbda08d31bcd-cgu.0.rcgu.o'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to 1 previous error




"/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/rustc-clif" "--cap-lints=allow" "-Csymbol-mangling-version=v0" "-Zunstable-options" "--check-cfg=cfg(bootstrap)" "--check-cfg=cfg(parallel_compiler)" "-Zmacro-backtrace" "-Csplit-debuginfo=unpacked" "-Zosx-rpath-install-name" "-Clink-args=-Wl,-rpath,@loader_path/../lib" "--cfg=parallel_compiler" "-Clink-arg=-undefined" "-Clink-arg=dynamic_lookup" "-L" "crate=/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example" "--out-dir" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example" "-Cdebuginfo=2" "--target" "x86_64-apple-darwin" "-Cpanic=abort" "-Zunstable-options" "--check-cfg=cfg(no_unstable_features)" "--check-cfg=cfg(jit)" "example/issue-72793.rs" "--cfg" "no_unstable_features" exited with status ExitStatus(unix_wait_status(256))
command did not execute successfully: cd "/Users/runner/work/rust/rust/compiler/rustc_codegen_cranelift" && env -u MAKEFLAGS -u MFLAGS AR_x86_64_apple_darwin="ar" CARGO_BUILD_INCREMENTAL="false" CARGO_INCREMENTAL="0" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-codegen" CC_x86_64_apple_darwin="sccache /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang" CFG_COMPILER_BUILD_TRIPLE="x86_64-apple-darwin" CFG_COMPILER_HOST_TRIPLE="x86_64-apple-darwin" CFG_DEFAULT_CODEGEN_BACKEND="llvm" CFG_LIBDIR_RELATIVE="lib" CFG_RELEASE="1.78.0-nightly" CFG_RELEASE_CHANNEL="nightly" CFG_VERSION="1.78.0-nightly (5225cd8d9 2024-02-10)" CFG_VER_DATE="2024-02-10" CFG_VER_HASH="5225cd8d989e5304b504d157c4235972ea322602" CFLAGS_x86_64_apple_darwin="-ffunction-sections -fdata-sections -fPIC --target=x86_64-apple-darwin" CXXFLAGS_x86_64_apple_darwin="-ffunction-sections -fdata-sections -fPIC --target=x86_64-apple-darwin -stdlib=libc++" CXX_x86_64_apple_darwin="sccache /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang++" LIBC_CHECK_CFG="1" LIBRARY_PATH="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/lib" LLVM_CONFIG="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/bin/llvm-config" LLVM_NDEBUG="1" LLVM_RUSTLLVM="1" RANLIB_x86_64_apple_darwin="ar s" REAL_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/native" RUSTC="/Users/runner/work/rust/rust/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/Users/runner/work/rust/rust/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_FLAGS="-Zunstable-options --check-cfg=cfg(bootstrap)" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings" RUSTC_PRINT_STEP_TIMINGS="1" RUSTC_REAL="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/bin/rustc" RUSTC_SNAPSHOT="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/lib" RUSTC_STAGE="1" RUSTC_SYSROOT="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1" RUSTC_VERBOSE="0" RUSTC_VERIFY_LLVM_IR="1" RUSTC_WRAPPER="/Users/runner/work/rust/rust/build/bootstrap/debug/rustc" RUSTDOC="/Users/runner/work/rust/rust/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.78.0-nightly\t(5225cd8d9\t2024-02-10) --cfg=parallel_compiler" RUSTDOC_LIBDIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/lib" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) -Zmacro-backtrace -Csplit-debuginfo=unpacked -Zosx-rpath-install-name -Clink-args=-Wl,-rpath,@loader_path/../lib --cfg=parallel_compiler" RUST_TEST_THREADS="4" TERM="xterm" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="nightlycodegen" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "run" "--target" "x86_64-apple-darwin" "--release" "-Zcheck-cfg" "-Zbinary-dep-depinfo" "-j" "4" "--locked" "--color" "always" "--manifest-path" "/Users/runner/work/rust/rust/compiler/rustc_codegen_cranelift/build_system/Cargo.toml" "--" "test" "--download-dir" "/Users/runner/work/rust/rust/build/cg_clif_download" "--out-dir" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif" "--no-unstable-features" "--use-backend" "cranelift" "--sysroot" "llvm" "--skip-test" "testsuite.extended_sysroot"

stdout ----

stderr ----

@bors
Copy link
Contributor

bors commented Feb 10, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 10, 2024
@matthiaskrgr
Copy link
Member

@bors retry invalid r_symbolnum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2024
Fold pointer operations in GVN

This PR proposes 2 combinations of cast operations in MIR GVN:
- a chain of `PtrToPtr` or `MutToConstPointer` casts can be folded together into a single `PtrToPtr` cast;
- we attempt to evaluate more ptr ops when there is no provenance.

In particular, this allows to read from static slices.

This is not yet sufficient to see through slice operations that use `PtrComponents` (because that's a union), but still a step forward.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Feb 11, 2024

⌛ Testing commit 7a6b00e with merge e8e63d2...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
error: linking with `cc` failed: exit status: 1

  |

  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/bin:/usr/local/lib/ruby/gems/3.0.0/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "x86_64" "-m64" "/var/folders/r0/ztvld9wd66bfpv_g6h3ksl000000gn/T/rustcztZS1h/symbols.o" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793.issue_72793.5ea43619f70b0ff6-cgu.0.rcgu.o" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793.allocator_shim.rcgu.o" "-L" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example" "-L" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libstd-a7ffcf8feb5de0df.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libpanic_abort-f72dbe40e56cf4e9.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libobject-93683961e4fe014c.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-608f39623da2acc6.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-2b17e3e98a369b70.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libgimli-98e18d571f0d3c98.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-105905fe6fc6bf57.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-c72f1c866e7081dc.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-e82114027f985b88.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-f99fcd695211a1c9.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-9bba2c1110da01a8.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libadler-f86ef4dff75dd50c.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libunwind-0b11117ce25a1560.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-3fce4a1c07607df0.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/liblibc-e38fe75b4b440008.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2b3dd1868cffbb25.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-0171fe66a8ec9014.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libcore-939f78aa140a5d6b.rlib" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-83f97429b7f69221.rlib" "-lSystem" "-lc" "-lm" "-L" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793" "-Wl,-dead_strip" "-nodefaultlibs" "-Wl,-rpath,@loader_path/../lib" "-undefined" "dynamic_lookup"
command did not execute successfully: cd "/Users/runner/work/rust/rust/compiler/rustc_codegen_cranelift" && env -u MAKEFLAGS -u MFLAGS AR_x86_64_apple_darwin="ar" CARGO_BUILD_INCREMENTAL="false" CARGO_INCREMENTAL="0" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="false" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="false" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-codegen" CC_x86_64_apple_darwin="sccache /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang" CFG_COMPILER_BUILD_TRIPLE="x86_64-apple-darwin" CFG_COMPILER_HOST_TRIPLE="x86_64-apple-darwin" CFG_DEFAULT_CODEGEN_BACKEND="llvm" CFG_LIBDIR_RELATIVE="lib" CFG_RELEASE="1.78.0-nightly" CFG_RELEASE_CHANNEL="nightly" CFG_VERSION="1.78.0-nightly (e8e63d263 2024-02-11)" CFG_VER_DATE="2024-02-11" CFG_VER_HASH="e8e63d263a1c31ab97bc338ab45baef6fe999dd5" CFLAGS_x86_64_apple_darwin="-ffunction-sections -fdata-sections -fPIC --target=x86_64-apple-darwin" CXXFLAGS_x86_64_apple_darwin="-ffunction-sections -fdata-sections -fPIC --target=x86_64-apple-darwin -stdlib=libc++" CXX_x86_64_apple_darwin="sccache /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang++" LIBC_CHECK_CFG="1" LIBRARY_PATH="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/lib" LLVM_CONFIG="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/ci-llvm/bin/llvm-config" LLVM_NDEBUG="1" LLVM_RUSTLLVM="1" RANLIB_x86_64_apple_darwin="ar s" REAL_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/native" RUSTC="/Users/runner/work/rust/rust/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/Users/runner/work/rust/rust/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_FLAGS="-Zunstable-options --check-cfg=cfg(bootstrap)" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings" RUSTC_PRINT_STEP_TIMINGS="1" RUSTC_REAL="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/bin/rustc" RUSTC_SNAPSHOT="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/lib" RUSTC_STAGE="1" RUSTC_SYSROOT="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1" RUSTC_VERBOSE="0" RUSTC_VERIFY_LLVM_IR="1" RUSTC_WRAPPER="/Users/runner/work/rust/rust/build/bootstrap/debug/rustc" RUSTDOC="/Users/runner/work/rust/rust/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="-Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.78.0-nightly\t(e8e63d263\t2024-02-11) --cfg=parallel_compiler" RUSTDOC_LIBDIR="/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1/lib" RUSTDOC_REAL="/path/to/nowhere/rustdoc/not/required" RUSTFLAGS="-Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) -Zmacro-backtrace -Csplit-debuginfo=unpacked -Zosx-rpath-install-name -Clink-args=-Wl,-rpath,@loader_path/../lib --cfg=parallel_compiler" RUST_TEST_THREADS="4" TERM="xterm" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="nightlycodegen" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "run" "--target" "x86_64-apple-darwin" "--release" "-Zcheck-cfg" "-Zbinary-dep-depinfo" "-j" "4" "--locked" "--color" "always" "--manifest-path" "/Users/runner/work/rust/rust/compiler/rustc_codegen_cranelift/build_system/Cargo.toml" "--" "test" "--download-dir" "/Users/runner/work/rust/rust/build/cg_clif_download" "--out-dir" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif" "--no-unstable-features" "--use-backend" "cranelift" "--sysroot" "llvm" "--skip-test" "testsuite.extended_sysroot"
  = note: ld: invalid r_symbolnum=14 in '/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example/issue-72793.issue_72793.5ea43619f70b0ff6-cgu.0.rcgu.o'
expected success, got: exit status: 1
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          
stdout ----



error: aborting due to 1 previous error
stderr ----


"/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/dist/rustc-clif" "--cap-lints=allow" "-Csymbol-mangling-version=v0" "-Zunstable-options" "--check-cfg=cfg(bootstrap)" "--check-cfg=cfg(parallel_compiler)" "-Zmacro-backtrace" "-Csplit-debuginfo=unpacked" "-Zosx-rpath-install-name" "-Clink-args=-Wl,-rpath,@loader_path/../lib" "--cfg=parallel_compiler" "-Clink-arg=-undefined" "-Clink-arg=dynamic_lookup" "-L" "crate=/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example" "--out-dir" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/stage1-tools/cg_clif/build/example" "-Cdebuginfo=2" "--target" "x86_64-apple-darwin" "-Cpanic=abort" "-Zunstable-options" "--check-cfg=cfg(no_unstable_features)" "--check-cfg=cfg(jit)" "example/issue-72793.rs" "--cfg" "no_unstable_features" exited with status ExitStatus(unix_wait_status(256))
Build completed unsuccessfully in 0:44:22

  local time: Sun Feb 11 01:16:38 UTC 2024
  network time: Sun, 11 Feb 2024 01:16:38 GMT

@bors
Copy link
Contributor

bors commented Feb 11, 2024

💔 Test failed - checks-actions

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

@bors retry invalid r_symbolnum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 11, 2024
@bors
Copy link
Contributor

bors commented Feb 11, 2024

⌛ Testing commit 7a6b00e with merge 9aa232e...

@bors
Copy link
Contributor

bors commented Feb 11, 2024

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 9aa232e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 11, 2024
@bors bors merged commit 9aa232e into rust-lang:master Feb 11, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 11, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9aa232e): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.9% [0.7%, 1.1%] 2
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-0.5% [-0.8%, -0.3%] 4
Improvements ✅
(secondary)
-1.8% [-1.8%, -1.8%] 1
All ❌✅ (primary) 0.0% [-0.8%, 1.1%] 6

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)
6.3% [3.4%, 10.9%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-2.7%, -0.3%] 2
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) 4.1% [-2.7%, 10.9%] 7

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)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-2.9% [-4.2%, -1.9%] 7
All ❌✅ (primary) 0.1% [-0.8%, 1.1%] 2

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.2% [0.0%, 3.7%] 51
Regressions ❌
(secondary)
0.8% [0.1%, 1.3%] 38
Improvements ✅
(primary)
-0.2% [-0.6%, -0.1%] 18
Improvements ✅
(secondary)
-0.6% [-3.2%, -0.1%] 11
All ❌✅ (primary) 0.1% [-0.6%, 3.7%] 69

Bootstrap: 668.04s -> 665.965s (-0.31%)
Artifact size: 308.26 MiB -> 308.33 MiB (0.02%)

@nnethercote
Copy link
Contributor

The binary size results aren't good here, though the worst of the regressions are on secondary benchmarks. Was that expected? Can anything be done to improve it?

@Kobzol
Copy link
Contributor

Kobzol commented Feb 13, 2024

The metadata got larger, binary size not at all, or just very slightly. I think that's fine.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 13, 2024
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 merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

10 participants