-
Notifications
You must be signed in to change notification settings - Fork 13.7k
compiler: Stop manually extending the stack #134153
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
compiler: Stop manually extending the stack #134153
Conversation
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
Some changes occurred to the CTFE machinery
cc @rust-lang/wg-const-eval
Some changes occurred to the core trait solver
cc @rust-lang/initiative-trait-system-refactor
Some changes occurred in match lowering
cc @Nadrieril
Some changes occurred in match checking
cc @Nadrieril
changes to the core type system
Some changes occurred in exhaustiveness checking
cc @Nadrieril
uh... sorry? ^^;
@bors try @rust-timer queue
This comment has been minimized.
This comment has been minimized.
...ms, r=<try> compiler: Stop manually extending the stack This rips out almost all calls to `ensure_sufficient_stack`, and disables the actual function itself for the handful of calls that proved too annoying to immediately rip out, for rebasing or type inference reasons. r? `@ghost`
what is the motivation for this change? presumably this will cause legitimate regressions on a mixture of both real and pathological examples. are you just trying to figure out the perf implications here?
@compiler-errors Currently, yes, this is just a perf experiment.
I am aware of the regressions because I have committed some of the regression tests that will now fail with this version of the compiler.
If this stops being a perf experiment, it will come with a second commit that covers the real regressions. Hopefully with less of a performance impact in non-pathological cases.
The job x86_64-gnu-llvm-18
failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 28.3s done
#16 DONE 33.7s
##[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-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
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-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--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', 'rust.lld=false', '--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-18/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
Compiling gccjit v2.2.0
Compiling rustc_codegen_gcc v0.1.0 (/checkout/compiler/rustc_codegen_gcc)
error: rustc interrupted by SIGSEGV, printing backtrace
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0xb5e0e6)[0x7fce84e890e6]
/lib/x86_64-linux-gnu/libc.so.6(+0x45320)[0x7fce8415a320]
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0x1e36751)[0x7fce86161751]
### cycle encountered after 3 frames with period 4
### cycle encountered after 3 frames with period 4
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0x1f29da6)[0x7fce86254da6]
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0x1f115b8)[0x7fce8623c5b8]
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0x1e22cf3)[0x7fce8614dcf3]
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0x1e1ff63)[0x7fce8614af63]
### recursed 63 times
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/librustc_driver-1870b16e566575ab.so(+0x1f29da6)[0x7fce86254da6]
note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
rustc exited with signal: 11 (SIGSEGV) (core dumped)
error: could not compile `rustc_codegen_gcc` (lib)
Caused by:
Caused by:
process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_codegen_gcc --edition=2018 compiler/rustc_codegen_gcc/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type dylib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --cfg 'feature="default"' --cfg 'feature="master"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("default", "master"))' -C metadata=d318bbec14490148 -C extra-filename=-d318bbec14490148 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/release/deps --extern gccjit=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/deps/libgccjit-9e01e5e4d3af194a.rlib -Csymbol-mangling-version=v0 -Zrandomize-layout -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off -Cllvm-args=-import-instr-limit=10 -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Z binary-dep-depinfo` (exit status: 254)
local time: Wed Dec 11 00:11:17 UTC 2024
network time: 2024年12月11日 00:11:17 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
☀️ Try build successful - checks-actions
Build commit: 0e81fd6 (0e81fd6ef5ce355cc007e8fd91211d6285328e77
)
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (0e81fd6): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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 Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -2.4%)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.
CyclesResults (primary -1.3%, secondary 2.6%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 768.372s -> 762.235s (-0.80%) |
This rips out almost all calls to
ensure_sufficient_stack
, and disables the actual function itself for the handful of calls that proved too annoying to immediately rip out, for rebasing or type inference reasons.r? @ghost