File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
rustc_codegen_ssa/src/back Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ fn generate_enzyme_call<'ll>(
276
276
}
277
277
278
278
pub ( crate ) fn differentiate < ' ll > (
279
- module : & ' ll ModuleCodegen < ModuleLlvm > ,
279
+ module_llvm : & ' ll ModuleLlvm ,
280
280
cgcx : & CodegenContext < LlvmCodegenBackend > ,
281
281
diff_items : Vec < AutoDiffItem > ,
282
282
_config : & ModuleConfig ,
@@ -286,7 +286,7 @@ pub(crate) fn differentiate<'ll>(
286
286
}
287
287
288
288
let diag_handler = cgcx. create_dcx ( ) ;
289
- let cx = SimpleCx { llmod : module . module_llvm . llmod ( ) , llcx : module . module_llvm . llcx } ;
289
+ let cx = SimpleCx { llmod : module_llvm. llmod ( ) , llcx : module_llvm. llcx } ;
290
290
291
291
// First of all, did the user try to use autodiff without using the -Zautodiff=Enable flag?
292
292
if !diff_items. is_empty ( )
Original file line number Diff line number Diff line change @@ -241,7 +241,8 @@ impl WriteBackendMethods for LlvmCodegenBackend {
241
241
let dcx = cgcx. create_dcx ( ) ;
242
242
return Err ( dcx. handle ( ) . emit_almost_fatal ( AutoDiffWithoutLTO ) ) ;
243
243
}
244
- builder:: autodiff:: differentiate ( module, cgcx, diff_fncs, config)
244
+ let module_llvm = & module. module_llvm ;
245
+ builder:: autodiff:: differentiate ( module_llvm, cgcx, diff_fncs, config)
245
246
}
246
247
}
247
248
Original file line number Diff line number Diff line change @@ -1473,13 +1473,14 @@ fn start_executing_work<B: ExtraBackendMethods>(
1473
1473
assert ! ( !started_lto) ;
1474
1474
started_lto = true ;
1475
1475
1476
+ let autodiff_items = mem:: take ( & mut autodiff_items) ;
1476
1477
let needs_fat_lto = mem:: take ( & mut needs_fat_lto) ;
1477
1478
let needs_thin_lto = mem:: take ( & mut needs_thin_lto) ;
1478
1479
let import_only_modules = mem:: take ( & mut lto_import_only_modules) ;
1479
1480
1480
1481
for ( work, cost) in generate_lto_work (
1481
1482
& cgcx,
1482
- autodiff_items. clone ( ) ,
1483
+ autodiff_items,
1483
1484
needs_fat_lto,
1484
1485
needs_thin_lto,
1485
1486
import_only_modules,
You can’t perform that action at this time.
0 commit comments