Skip to content
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

codegen_ssa cleanups #113879

Merged
merged 20 commits into from
Jul 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Inline and remove submit_pre_codegened_module_to_llvm.
It has a single callsite, and provides little value.
nnethercote committed Jul 31, 2023
commit a8c71f0a15983a17ed07490feb4a195ababff439
13 changes: 0 additions & 13 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
@@ -1962,19 +1962,6 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
)
}

pub fn submit_pre_codegened_module_to_llvm(
&self,
tcx: TyCtxt<'_>,
module: ModuleCodegen<B::Module>,
) {
self.wait_for_signal_to_codegen_item();
self.check_for_errors(tcx.sess);

// These are generally cheap and won't throw off scheduling.
let cost = 0;
submit_codegened_module_to_llvm(&self.backend, &self.coordinator.sender, module, cost);
}

pub fn codegen_finished(&self, tcx: TyCtxt<'_>) {
self.wait_for_signal_to_codegen_item();
self.check_for_errors(tcx.sess);
11 changes: 9 additions & 2 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
@@ -664,9 +664,16 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
)
});

ongoing_codegen.submit_pre_codegened_module_to_llvm(
tcx,
ongoing_codegen.wait_for_signal_to_codegen_item();
ongoing_codegen.check_for_errors(tcx.sess);

// These modules are generally cheap and won't throw off scheduling.
let cost = 0;
submit_codegened_module_to_llvm(
&backend,
&ongoing_codegen.coordinator.sender,
ModuleCodegen { name: llmod_id, module_llvm, kind: ModuleKind::Allocator },
cost,
);
}