@@ -7,7 +7,6 @@ use std::{fs, io, mem, str, thread};
77
88use rustc_abi:: Size ;
99use rustc_ast:: attr;
10- use rustc_ast:: expand:: autodiff_attrs:: AutoDiffItem ;
1110use rustc_data_structures:: fx:: FxIndexMap ;
1211use rustc_data_structures:: jobserver:: { self , Acquired } ;
1312use rustc_data_structures:: memmap:: Mmap ;
@@ -38,7 +37,7 @@ use tracing::debug;
3837use super :: link:: { self , ensure_removed} ;
3938use super :: lto:: { self , SerializedModule } ;
4039use crate :: back:: lto:: check_lto_allowed;
41- use crate :: errors:: { AutodiffWithoutLto , ErrorCreatingRemarkDir } ;
40+ use crate :: errors:: ErrorCreatingRemarkDir ;
4241use crate :: traits:: * ;
4342use crate :: {
4443 CachedModuleCodegen , CodegenResults , CompiledModule , CrateInfo , ModuleCodegen , ModuleKind ,
@@ -454,7 +453,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
454453 backend : B ,
455454 tcx : TyCtxt < ' _ > ,
456455 target_cpu : String ,
457- autodiff_items : & [ AutoDiffItem ] ,
458456) -> OngoingCodegen < B > {
459457 let ( coordinator_send, coordinator_receive) = channel ( ) ;
460458
@@ -473,7 +471,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
473471 backend. clone ( ) ,
474472 tcx,
475473 & crate_info,
476- autodiff_items,
477474 shared_emitter,
478475 codegen_worker_send,
479476 coordinator_receive,
@@ -728,7 +725,6 @@ pub(crate) enum WorkItem<B: WriteBackendMethods> {
728725 each_linked_rlib_for_lto : Vec < PathBuf > ,
729726 needs_fat_lto : Vec < FatLtoInput < B > > ,
730727 import_only_modules : Vec < ( SerializedModule < B :: ModuleBuffer > , WorkProduct ) > ,
731- autodiff : Vec < AutoDiffItem > ,
732728 } ,
733729 /// Performs thin-LTO on the given module.
734730 ThinLto ( lto:: ThinModule < B > ) ,
@@ -1001,7 +997,6 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
1001997 each_linked_rlib_for_lto : & [ PathBuf ] ,
1002998 mut needs_fat_lto : Vec < FatLtoInput < B > > ,
1003999 import_only_modules : Vec < ( SerializedModule < B :: ModuleBuffer > , WorkProduct ) > ,
1004- autodiff : Vec < AutoDiffItem > ,
10051000 module_config : & ModuleConfig ,
10061001) -> Result < WorkItemResult < B > , FatalError > {
10071002 for ( module, wp) in import_only_modules {
@@ -1013,7 +1008,6 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
10131008 exported_symbols_for_lto,
10141009 each_linked_rlib_for_lto,
10151010 needs_fat_lto,
1016- autodiff,
10171011 ) ?;
10181012 let module = B :: codegen ( cgcx, module, module_config) ?;
10191013 Ok ( WorkItemResult :: Finished ( module) )
@@ -1105,7 +1099,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
11051099 backend : B ,
11061100 tcx : TyCtxt < ' _ > ,
11071101 crate_info : & CrateInfo ,
1108- autodiff_items : & [ AutoDiffItem ] ,
11091102 shared_emitter : SharedEmitter ,
11101103 codegen_worker_send : Sender < CguMessage > ,
11111104 coordinator_receive : Receiver < Message < B > > ,
@@ -1115,7 +1108,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
11151108) -> thread:: JoinHandle < Result < CompiledModules , ( ) > > {
11161109 let coordinator_send = tx_to_llvm_workers;
11171110 let sess = tcx. sess ;
1118- let autodiff_items = autodiff_items. to_vec ( ) ;
11191111
11201112 let mut each_linked_rlib_for_lto = Vec :: new ( ) ;
11211113 let mut each_linked_rlib_file_for_lto = Vec :: new ( ) ;
@@ -1448,19 +1440,13 @@ fn start_executing_work<B: ExtraBackendMethods>(
14481440 each_linked_rlib_for_lto : each_linked_rlib_file_for_lto,
14491441 needs_fat_lto,
14501442 import_only_modules,
1451- autodiff : autodiff_items. clone ( ) ,
14521443 } ,
14531444 0 ,
14541445 ) ) ;
14551446 if cgcx. parallel {
14561447 helper. request_token ( ) ;
14571448 }
14581449 } else {
1459- if !autodiff_items. is_empty ( ) {
1460- let dcx = cgcx. create_dcx ( ) ;
1461- dcx. handle ( ) . emit_fatal ( AutodiffWithoutLto { } ) ;
1462- }
1463-
14641450 for ( work, cost) in generate_thin_lto_work (
14651451 & cgcx,
14661452 & exported_symbols_for_lto,
@@ -1795,7 +1781,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
17951781 each_linked_rlib_for_lto,
17961782 needs_fat_lto,
17971783 import_only_modules,
1798- autodiff,
17991784 } => {
18001785 let _timer = cgcx
18011786 . prof
@@ -1806,7 +1791,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
18061791 & each_linked_rlib_for_lto,
18071792 needs_fat_lto,
18081793 import_only_modules,
1809- autodiff,
18101794 module_config,
18111795 )
18121796 }
0 commit comments