Skip to content

Post-mono MIR opts #130051

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

Closed
wants to merge 3 commits into from
Closed

Post-mono MIR opts #130051

wants to merge 3 commits into from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Sep 6, 2024

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Sep 6, 2024

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Sep 6, 2024
@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 6, 2024

@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 Sep 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2024
@bors
Copy link
Collaborator

bors commented Sep 6, 2024

⌛ Trying commit 83effc2 with merge 8aad989...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Sep 6, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 6, 2024
@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 7, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Sep 7, 2024

⌛ Trying commit 142c276 with merge 388d6dc...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 7, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Sep 7, 2024

☀️ Try build successful - checks-actions
Build commit: 388d6dc (388d6dc0ebeba060e002e4c0111f92a25aedc437)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (388d6dc): 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.2%, 1.2%] 21
Regressions ❌
(secondary)
9.2% [0.3%, 18.2%] 2
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-0.3%, 1.2%] 25

Max RSS (memory usage)

Results (primary -0.7%)

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)
7.2% [7.2%, 7.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.2% [-5.7%, -0.9%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-5.7%, 7.2%] 6

Cycles

Results (secondary 8.8%)

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)
8.8% [1.0%, 16.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%)

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%, 0.8%] 10
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.3%, -0.0%] 14
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.3%, 0.8%] 24

Bootstrap: 756.217s -> 761.565s (0.71%)
Artifact size: 341.14 MiB -> 341.21 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 7, 2024
@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 7, 2024

@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 Sep 7, 2024
@bors
Copy link
Collaborator

bors commented Sep 7, 2024

⌛ Trying commit 6ded72b with merge 182dada...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 7, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Sep 7, 2024

☀️ Try build successful - checks-actions
Build commit: 182dada (182dada668a27730142b220c3841f69cd4e880ca)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (182dada): 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.0% [0.3%, 4.7%] 202
Regressions ❌
(secondary)
1.3% [0.1%, 20.2%] 132
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-2.2%, -0.3%] 11
All ❌✅ (primary) 1.0% [0.3%, 4.7%] 202

Max RSS (memory usage)

Results (primary -0.8%, secondary -1.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.

mean range count
Regressions ❌
(primary)
2.7% [1.1%, 4.3%] 15
Regressions ❌
(secondary)
2.6% [1.9%, 3.3%] 3
Improvements ✅
(primary)
-4.6% [-8.3%, -1.4%] 14
Improvements ✅
(secondary)
-4.4% [-6.9%, -2.4%] 4
All ❌✅ (primary) -0.8% [-8.3%, 4.3%] 29

Cycles

Results (primary 2.7%, secondary 4.1%)

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.0%, 10.2%] 58
Regressions ❌
(secondary)
4.4% [2.0%, 18.7%] 25
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) 2.7% [1.0%, 10.2%] 58

Binary size

Results (primary -0.0%, secondary -0.2%)

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%, 0.8%] 29
Regressions ❌
(secondary)
0.9% [0.2%, 2.5%] 9
Improvements ✅
(primary)
-0.2% [-0.5%, -0.0%] 36
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.1%] 43
All ❌✅ (primary) -0.0% [-0.5%, 0.8%] 65

Bootstrap: 756.798s -> 771.578s (1.95%)
Artifact size: 341.03 MiB -> 341.18 MiB (0.04%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 7, 2024
@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 5, 2025

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 5, 2025
bors added a commit that referenced this pull request Jul 5, 2025
@bors
Copy link
Collaborator

bors commented Jul 5, 2025

⌛ Trying commit 5a7e9c9 with merge f5dd817...

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 5, 2025

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

bors added a commit that referenced this pull request Jul 5, 2025
@bors
Copy link
Collaborator

bors commented Jul 5, 2025

⌛ Trying commit 6d0ad45 with merge 3afb598...

@cjgillot cjgillot added the A-mir-opt Area: MIR optimizations label Jul 5, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [mir-opt] tests/mir-opt/building/match/deref-patterns/string.rs stdout ----

error: compilation failed!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/mir-opt/building/match/deref-patterns/string.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "-Copt-level=1" "-Zdump-mir=PreCodegen" "-Zvalidate-mir" "-Zlint-mir" "-Zdump-mir-exclude-pass-number" "-Zmir-include-spans=false" "--crate-type=rlib" "-Zmir-opt-level=4" "-Zmir-enable-passes=+ReorderBasicBlocks,+ReorderLocals" "-Zdump-mir-dir=/checkout/obj/build/aarch64-unknown-linux-gnu/test/mir-opt/building/match/deref-patterns/string" "--emit" "mir" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/mir-opt/building/match/deref-patterns/string" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Z" "mir-opt-level=0" "-C" "panic=abort"
stdout: none
--- stderr -------------------------------
warning: unused variable: `s`
##[warning]  --> /checkout/tests/mir-opt/building/match/deref-patterns/string.rs:11:9
   |
11 |         s => 4321,
   |         ^ help: if this is intentional, prefix it with an underscore: `_s`
   |
   = note: `#[warn(unused_variables)]` on by default


thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:259:26:
broken MIR in Item(DefId(2:14678 ~ core[f840]::str::traits::{impl#1}::eq)) (after pass RemoveUnneededDrops) at bb0[6]:
`UnwindAction::Continue` in no-unwind function
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <rustc_mir_transform::validate::CfgChecker>::check_unwind_edge
   3: <rustc_mir_transform::validate::CfgChecker as rustc_middle::mir::visit::Visitor>::visit_terminator
   4: <rustc_mir_transform::validate::Validator as rustc_mir_transform::pass_manager::MirPass>::run_pass
   5: rustc_mir_transform::pass_manager::run_passes_inner
   6: rustc_codegen_ssa::mir::codegen_mir::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
   7: rustc_codegen_ssa::base::codegen_instance::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
   8: <rustc_middle::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
   9: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  10: rustc_codegen_llvm::base::compile_codegen_unit
  11: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  12: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: rustc_interface::passes::start_codegen
  14: <rustc_interface::queries::Linker>::codegen_and_build_linker
  15: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  16: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  17: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  18: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  19: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  20: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.90.0-nightly (351434e80 2025-07-05) running on aarch64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C opt-level=1 -Z dump-mir=PreCodegen -Z validate-mir -Z lint-mir -Z dump-mir-exclude-pass-number -Z mir-include-spans=false --crate-type rlib -Z mir-opt-level=4 -Z mir-enable-passes=+ReorderBasicBlocks,+ReorderLocals -Z dump-mir-dir=/checkout/obj/build/aarch64-unknown-linux-gnu/test/mir-opt/building/match/deref-patterns/string -C prefer-dynamic -C rpath -C debuginfo=0 -Z mir-opt-level=0 -C panic=abort

query stack during panic:
end of query stack
warning: 1 warning emitted
------------------------------------------


---- [mir-opt] tests/mir-opt/instsimplify/combine_transmutes.rs stdout ----

error: compilation failed!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/mir-opt/instsimplify/combine_transmutes.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "-Copt-level=1" "-Zdump-mir=InstSimplify-after-simplifycfg | InstSimplify-after-simplifycfg | InstSimplify-after-simplifycfg" "-Zvalidate-mir" "-Zlint-mir" "-Zdump-mir-exclude-pass-number" "-Zmir-include-spans=false" "--crate-type=rlib" "-Zmir-opt-level=0" "-Zmir-enable-passes=+InstSimplify-after-simplifycfg" "-Zdump-mir-dir=/checkout/obj/build/aarch64-unknown-linux-gnu/test/mir-opt/instsimplify/combine_transmutes" "--emit" "mir" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/mir-opt/instsimplify/combine_transmutes" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-C" "panic=abort"
stdout: none
--- stderr -------------------------------
warning: unused imports: `ManuallyDrop` and `MaybeUninit`
##[warning] --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:8:16
  |
---

warning: variable `A` is assigned to, but never used
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:36:17
   |
36 |             let A = CastTransmute::<i32, u32>(1); // Can be a cast
   |                 ^
   |
   = note: consider using `_A` instead
   = note: `#[warn(unused_variables)]` on by default

---

warning: variable `C` is assigned to, but never used
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:38:17
   |
38 |             let C = CastTransmute::<u64, i64>(1); // Can be a cast
   |                 ^
   |
   = note: consider using `_C` instead

warning: variable `D` is assigned to, but never used
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:39:17
   |
39 |             let D = CastTransmute::<u64, u32>(1); // UB
   |                 ^
   |
   = note: consider using `_D` instead

warning: variable `E` is assigned to, but never used
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:40:17
   |
40 |             let E = CastTransmute::<isize, usize>(1); // Can be a cast
   |                 ^
   |
   = note: consider using `_E` instead

warning: fields `u32` and `i32` are never read
---
   |     ^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: variable `A` should have a snake case name
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:36:17
   |
36 |             let A = CastTransmute::<i32, u32>(1); // Can be a cast
   |                 ^ help: convert the identifier to snake case: `a`
   |
   = note: `#[warn(non_snake_case)]` on by default

warning: variable `B` should have a snake case name
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:37:17
   |
37 |             let B = CastTransmute::<i32, i64>(1); // UB
   |                 ^ help: convert the identifier to snake case: `b`

warning: variable `C` should have a snake case name
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:38:17
   |
38 |             let C = CastTransmute::<u64, i64>(1); // Can be a cast
   |                 ^ help: convert the identifier to snake case (notice the capitalization): `c`

warning: variable `D` should have a snake case name
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:39:17
   |
39 |             let D = CastTransmute::<u64, u32>(1); // UB
   |                 ^ help: convert the identifier to snake case: `d`

warning: variable `E` should have a snake case name
##[warning]  --> /checkout/tests/mir-opt/instsimplify/combine_transmutes.rs:40:17
   |
40 |             let E = CastTransmute::<isize, usize>(1); // Can be a cast
   |                 ^ help: convert the identifier to snake case: `e`


thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:259:26:
broken MIR in Item(DefId(3:8343 ~ alloc[3285]::vec::{impl#25}::drop)) (after pass RemoveUnneededDrops) at bb0[11]:
`UnwindAction::Continue` in no-unwind function
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <rustc_mir_transform::validate::CfgChecker>::check_unwind_edge
   3: <rustc_mir_transform::validate::CfgChecker as rustc_middle::mir::visit::Visitor>::visit_terminator
   4: <rustc_mir_transform::validate::Validator as rustc_mir_transform::pass_manager::MirPass>::run_pass
   5: rustc_mir_transform::pass_manager::run_passes_inner
   6: rustc_codegen_ssa::mir::codegen_mir::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
   7: rustc_codegen_ssa::base::codegen_instance::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
   8: <rustc_middle::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define::<rustc_codegen_llvm::builder::GenericBuilder<rustc_codegen_llvm::context::FullCx>>
   9: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  10: rustc_codegen_llvm::base::compile_codegen_unit
  11: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  12: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: rustc_interface::passes::start_codegen
  14: <rustc_interface::queries::Linker>::codegen_and_build_linker
  15: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  16: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  17: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  18: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  19: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  20: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.90.0-nightly (351434e80 2025-07-05) running on aarch64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C opt-level=1 -Z dump-mir=InstSimplify-after-simplifycfg | InstSimplify-after-simplifycfg | InstSimplify-after-simplifycfg -Z validate-mir -Z lint-mir -Z dump-mir-exclude-pass-number -Z mir-include-spans=false --crate-type rlib -Z mir-opt-level=0 -Z mir-enable-passes=+InstSimplify-after-simplifycfg -Z dump-mir-dir=/checkout/obj/build/aarch64-unknown-linux-gnu/test/mir-opt/instsimplify/combine_transmutes -C prefer-dynamic -C rpath -C debuginfo=0 -C panic=abort

query stack during panic:
end of query stack
warning: 12 warnings emitted
------------------------------------------

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-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

6 participants