1
Fork 0

Auto merge of #136413 - EnzymeAD:fix-autodiff-comptime-regression, r=oli-obk

fix autodiff compile time regression

Tries to fix the regression from https://github.com/rust-lang/rust/pull/133429

Tracking:

- https://github.com/rust-lang/rust/issues/124509
This commit is contained in:
bors 2025-02-03 11:10:56 +00:00
commit a5db378dc1
2 changed files with 10 additions and 10 deletions

View file

@ -403,7 +403,7 @@ fn generate_lto_work<B: ExtraBackendMethods>(
assert!(needs_thin_lto.is_empty());
let mut module =
B::run_fat_lto(cgcx, needs_fat_lto, import_only_modules).unwrap_or_else(|e| e.raise());
if cgcx.lto == Lto::Fat {
if cgcx.lto == Lto::Fat && !autodiff.is_empty() {
let config = cgcx.config(ModuleKind::Regular);
module = unsafe { module.autodiff(cgcx, autodiff, config).unwrap() };
}