1
Fork 0
rust/compiler/rustc_codegen_ssa/src
bors 5a6c1aa2bc Auto merge of #121421 - saethlin:smarter-mono, r=oli-obk
Avoid lowering code under dead SwitchInt targets

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.
2024-03-13 05:07:26 +00:00
..
back Change DefKind::Static to a struct variant 2024-03-12 05:53:46 +00:00
debuginfo Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
mir Auto merge of #121421 - saethlin:smarter-mono, r=oli-obk 2024-03-13 05:07:26 +00:00
traits Check whether a static is mutable instead of passing it down 2024-03-12 05:53:46 +00:00
assert_module_sources.rs Rename IntoDiagnosticArg as IntoDiagArg. 2024-03-11 09:12:19 +11:00
base.rs use ptradd for vtable indexing 2024-03-10 22:47:30 -04:00
codegen_attrs.rs Fix misleading message when using a named constant as a struct alignment/pack 2024-03-02 23:15:39 +08:00
common.rs Sink ptrtoint for RMW ops on pointers to cg_llvm 2024-03-09 10:08:53 -05:00
errors.rs Rename IntoDiagnostic as Diagnostic. 2024-03-11 09:15:09 +11:00
lib.rs clean up potential_query_instability with FxIndexMap and UnordMap 2024-02-14 18:36:37 +08:00
meth.rs use ptradd for vtable indexing 2024-03-10 22:47:30 -04:00
mono_item.rs Check whether a static is mutable instead of passing it down 2024-03-12 05:53:46 +00:00
size_of_val.rs fix computing the dynamic alignment of packed structs with dyn trait tails 2023-12-13 20:21:57 +01:00
target_features.rs Bump indexmap 2024-02-13 21:03:34 +00:00