codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2 - #160060
codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2#160060glandium wants to merge 3 commits into
Conversation
…ator" This reverts commit 9e9467a.
…-uninit constants" This reverts commit ed9de1e.
MIR GVN propagates MaybeUninit::uninit() as `const <uninit>` in aggregate constructions and codegen emits a memcpy from an `[N x i8] undef` global for each such field, which LLVM materializes as zero-initialization. We extract the existing `all_bytes_uninit` skip already present for `Rvalue::Use` and `Rvalue::Repeat` to a separate helper function, and use it in the `Rvalue::Aggregate` field loop.
|
|
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (15257d1): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 6.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.1%, secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 490.22s -> 490.477s (0.05%) |
|
@bors r+ |
codegen: skip stores for entirely-uninit constant aggregate fields, attempt rust-lang#2 This reverts both rust-lang#159825 and rust-lang#157797, and goes back to the original fix from rust-lang#157797, albeit with a small refactor to share code between the now three branches that do the same check. This preserves the original issue (rust-lang#157743) in a fixed state, but avoids the whack-a-mole the initially landed attempt created. Fixes: rust-lang#159867 r? @oli-obk
…uwer Rollup of 21 pull requests Successful merges: - #159990 (Many "predicate"-to-"clause" renamings) - #159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly) - #159687 (rustdoc: Set tracing max_level_info when debug-logging is false) - #160057 (refactor(mir-transform): Calculate optimization status inside `run_passes_inner`) - #160060 (codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2) - #160063 (Fix ICE when dumping the dep graph with the parallel frontend) - #160065 (Distinguish the dep-graph index space from the live node count) - #158038 (Split register_tool into register_attribute_tool and register_lint_tool) - #159776 (remove const hack in alloc) - #159978 (run intrinsic-test by default on x86_64-gnu) - #160008 (Avoid stale closure recovery state across statements) - #160027 (Add regression test for #132767) - #160030 (Update `browser-ui-test` version to `0.25.0`) - #160046 (Improve consistency of attribute error messages (part 2)) - #160056 (Fix associated function suggestion for generic ADTs) - #160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY]) - #160071 (sanitize_standard_fds: clarify macos comment) - #160076 (use unstable features when updating dependencies) - #160092 (miri ui tests: don't run native tests on stage 0) - #160093 (Switch cargo assignments to weihanglo) - #160094 (Update assignment for docs)
This reverts both #159825 and #157797, and goes back to the original fix from #157797, albeit with a small refactor to share code between the now three branches that do the same check. This preserves the original issue (#157743) in a fixed state, but avoids the whack-a-mole the initially landed attempt created.
Fixes: #159867
r? @oli-obk