Merge run_fat_lto, optimize_fat and autodiff into run_and_optimize_fat_lto

This commit is contained in:
bjorn3
2025-07-03 16:22:32 +00:00
parent 8d63c7a1d6
commit 21026cae8d
6 changed files with 26 additions and 69 deletions

View File

@@ -995,17 +995,7 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
autodiff: Vec<AutoDiffItem>,
module_config: &ModuleConfig,
) -> Result<WorkItemResult<B>, FatalError> {
let mut module =
B::run_fat_lto(cgcx, needs_fat_lto, import_only_modules).unwrap_or_else(|e| e.raise());
if !autodiff.is_empty() {
if let Err(err) = B::autodiff(cgcx, &module, autodiff) {
err.raise();
}
}
B::optimize_fat(cgcx, &mut module)?;
let module = B::run_and_optimize_fat_lto(cgcx, needs_fat_lto, import_only_modules, autodiff)?;
let module = B::codegen(cgcx, module, module_config)?;
Ok(WorkItemResult::Finished(module))
}