Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 174810c

Browse files
committedOct 24, 2024
Auto merge of #131650 - saethlin:post-mono-mir-opts, r=<try>
Add post-mono MIR passes to make mono-reachable analysis more accurate As of #131650 (comment) I believe most of the incr overhead comes from re-computing, re-encoding, and loading a lot more MIR when all we're actually doing is traversing through it. I think that can be addressed by caching a query that looks up the mentioned/used items for an Instance. I think the full-build regressions are pretty much just the expense of cloning, then monomorphizing, then caching the MIR.
2 parents b8bb296 + 4ae3542 commit 174810c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+302
-386
lines changed
 

‎compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub(crate) fn codegen_fn<'tcx>(
4141
let symbol_name = tcx.symbol_name(instance).name.to_string();
4242
let _timer = tcx.prof.generic_activity_with_arg("codegen fn", &*symbol_name);
4343

44-
let mir = tcx.instance_mir(instance.def);
44+
let mir = tcx.build_codegen_mir(instance);
4545
let _mir_guard = crate::PrintOnPanic(|| {
4646
let mut buf = Vec::new();
4747
with_no_trimmed_paths!({

‎compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ pub(crate) fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
416416
// release builds.
417417
info!("codegen_instance({})", instance);
418418

419-
mir::codegen_mir::<Bx>(cx, instance);
419+
mir::lower_mir::<Bx>(cx, instance);
420420
}
421421

422422
/// Creates the `main` function which will initialize the rust runtime and call

0 commit comments

Comments
 (0)
Please sign in to comment.