@@ -8,7 +8,6 @@ use std::{fs, io, mem, str, thread};
88
99use rustc_abi:: Size ;
1010use rustc_ast:: attr;
11- use rustc_ast:: expand:: autodiff_attrs:: AutoDiffItem ;
1211use rustc_data_structures:: fx:: FxIndexMap ;
1312use rustc_data_structures:: jobserver:: { self , Acquired } ;
1413use rustc_data_structures:: memmap:: Mmap ;
@@ -39,7 +38,7 @@ use tracing::debug;
3938use super :: link:: { self , ensure_removed} ;
4039use super :: lto:: { self , SerializedModule } ;
4140use crate :: back:: lto:: check_lto_allowed;
42- use crate :: errors:: { AutodiffWithoutLto , ErrorCreatingRemarkDir } ;
41+ use crate :: errors:: ErrorCreatingRemarkDir ;
4342use crate :: traits:: * ;
4443use crate :: {
4544 CachedModuleCodegen , CodegenResults , CompiledModule , CrateInfo , ModuleCodegen , ModuleKind ,
@@ -455,7 +454,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
455454 backend : B ,
456455 tcx : TyCtxt < ' _ > ,
457456 target_cpu : String ,
458- autodiff_items : & [ AutoDiffItem ] ,
459457) -> OngoingCodegen < B > {
460458 let ( coordinator_send, coordinator_receive) = channel ( ) ;
461459
@@ -474,7 +472,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
474472 backend. clone ( ) ,
475473 tcx,
476474 & crate_info,
477- autodiff_items,
478475 shared_emitter,
479476 codegen_worker_send,
480477 coordinator_receive,
@@ -729,7 +726,6 @@ pub(crate) enum WorkItem<B: WriteBackendMethods> {
729726 each_linked_rlib_for_lto : Vec < PathBuf > ,
730727 needs_fat_lto : Vec < FatLtoInput < B > > ,
731728 import_only_modules : Vec < ( SerializedModule < B :: ModuleBuffer > , WorkProduct ) > ,
732- autodiff : Vec < AutoDiffItem > ,
733729 } ,
734730 /// Performs thin-LTO on the given module.
735731 ThinLto ( lto:: ThinModule < B > ) ,
@@ -1003,7 +999,6 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
1003999 each_linked_rlib_for_lto : & [ PathBuf ] ,
10041000 mut needs_fat_lto : Vec < FatLtoInput < B > > ,
10051001 import_only_modules : Vec < ( SerializedModule < B :: ModuleBuffer > , WorkProduct ) > ,
1006- autodiff : Vec < AutoDiffItem > ,
10071002 module_config : & ModuleConfig ,
10081003) -> Result < WorkItemResult < B > , FatalError > {
10091004 for ( module, wp) in import_only_modules {
@@ -1015,7 +1010,6 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
10151010 exported_symbols_for_lto,
10161011 each_linked_rlib_for_lto,
10171012 needs_fat_lto,
1018- autodiff,
10191013 ) ?;
10201014 let module = B :: codegen ( cgcx, module, module_config) ?;
10211015 Ok ( WorkItemResult :: Finished ( module) )
@@ -1119,7 +1113,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
11191113 backend : B ,
11201114 tcx : TyCtxt < ' _ > ,
11211115 crate_info : & CrateInfo ,
1122- autodiff_items : & [ AutoDiffItem ] ,
11231116 shared_emitter : SharedEmitter ,
11241117 codegen_worker_send : Sender < CguMessage > ,
11251118 coordinator_receive : Receiver < Box < dyn Any + Send > > ,
@@ -1129,7 +1122,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
11291122) -> thread:: JoinHandle < Result < CompiledModules , ( ) > > {
11301123 let coordinator_send = tx_to_llvm_workers;
11311124 let sess = tcx. sess ;
1132- let autodiff_items = autodiff_items. to_vec ( ) ;
11331125
11341126 let mut each_linked_rlib_for_lto = Vec :: new ( ) ;
11351127 let mut each_linked_rlib_file_for_lto = Vec :: new ( ) ;
@@ -1464,19 +1456,13 @@ fn start_executing_work<B: ExtraBackendMethods>(
14641456 each_linked_rlib_for_lto : each_linked_rlib_file_for_lto,
14651457 needs_fat_lto,
14661458 import_only_modules,
1467- autodiff : autodiff_items. clone ( ) ,
14681459 } ,
14691460 0 ,
14701461 ) ) ;
14711462 if cgcx. parallel {
14721463 helper. request_token ( ) ;
14731464 }
14741465 } else {
1475- if !autodiff_items. is_empty ( ) {
1476- let dcx = cgcx. create_dcx ( ) ;
1477- dcx. handle ( ) . emit_fatal ( AutodiffWithoutLto { } ) ;
1478- }
1479-
14801466 for ( work, cost) in generate_thin_lto_work (
14811467 & cgcx,
14821468 & exported_symbols_for_lto,
@@ -1827,7 +1813,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
18271813 each_linked_rlib_for_lto,
18281814 needs_fat_lto,
18291815 import_only_modules,
1830- autodiff,
18311816 } => {
18321817 let _timer = cgcx
18331818 . prof
@@ -1838,7 +1823,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
18381823 & each_linked_rlib_for_lto,
18391824 needs_fat_lto,
18401825 import_only_modules,
1841- autodiff,
18421826 module_config,
18431827 )
18441828 }
0 commit comments