Files
rust/compiler/rustc_codegen_llvm
bors e7795af6d2 Auto merge of #157797 - glandium:uninit, r=oli-obk
codegen: skip stores for entirely-uninit constant aggregate fields



MIR GVN (since rust-lang/rust#147827) propagates MaybeUninit::uninit() as `const <uninit>` in aggregate constructions. Without this fix, codegen would emit a memcpy from an `[N x i8] undef` global for each such field, which LLVM materializes as zero-initialization.

This mirrors the existing `all_bytes_uninit` skip already present for `Rvalue::Use` (added in rust-lang/rust#147827) into the `Rvalue::Aggregate` field loop.

Fixes: rust-lang/rust#157743
2026-07-22 22:50:42 +00:00
..

The codegen crate contains the code to convert from MIR into LLVM IR, and then from LLVM IR into machine code. In general it contains code that runs towards the end of the compilation process.

For more information about how codegen works, see the rustc dev guide.