@@ -8,7 +8,6 @@ use std::{fs, io, mem, str, thread};
8
8
9
9
use rustc_abi:: Size ;
10
10
use rustc_ast:: attr;
11
- use rustc_ast:: expand:: autodiff_attrs:: AutoDiffItem ;
12
11
use rustc_data_structures:: fx:: FxIndexMap ;
13
12
use rustc_data_structures:: jobserver:: { self , Acquired } ;
14
13
use rustc_data_structures:: memmap:: Mmap ;
@@ -39,7 +38,7 @@ use tracing::debug;
39
38
use super :: link:: { self , ensure_removed} ;
40
39
use super :: lto:: { self , SerializedModule } ;
41
40
use crate :: back:: lto:: check_lto_allowed;
42
- use crate :: errors:: { AutodiffWithoutLto , ErrorCreatingRemarkDir } ;
41
+ use crate :: errors:: ErrorCreatingRemarkDir ;
43
42
use crate :: traits:: * ;
44
43
use crate :: {
45
44
CachedModuleCodegen , CodegenResults , CompiledModule , CrateInfo , ModuleCodegen , ModuleKind ,
@@ -455,7 +454,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
455
454
backend : B ,
456
455
tcx : TyCtxt < ' _ > ,
457
456
target_cpu : String ,
458
- autodiff_items : & [ AutoDiffItem ] ,
459
457
) -> OngoingCodegen < B > {
460
458
let ( coordinator_send, coordinator_receive) = channel ( ) ;
461
459
@@ -474,7 +472,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
474
472
backend. clone ( ) ,
475
473
tcx,
476
474
& crate_info,
477
- autodiff_items,
478
475
shared_emitter,
479
476
codegen_worker_send,
480
477
coordinator_receive,
@@ -729,7 +726,6 @@ pub(crate) enum WorkItem<B: WriteBackendMethods> {
729
726
each_linked_rlib_for_lto : Vec < PathBuf > ,
730
727
needs_fat_lto : Vec < FatLtoInput < B > > ,
731
728
import_only_modules : Vec < ( SerializedModule < B :: ModuleBuffer > , WorkProduct ) > ,
732
- autodiff : Vec < AutoDiffItem > ,
733
729
} ,
734
730
/// Performs thin-LTO on the given module.
735
731
ThinLto ( lto:: ThinModule < B > ) ,
@@ -1003,7 +999,6 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
1003
999
each_linked_rlib_for_lto : & [ PathBuf ] ,
1004
1000
mut needs_fat_lto : Vec < FatLtoInput < B > > ,
1005
1001
import_only_modules : Vec < ( SerializedModule < B :: ModuleBuffer > , WorkProduct ) > ,
1006
- autodiff : Vec < AutoDiffItem > ,
1007
1002
module_config : & ModuleConfig ,
1008
1003
) -> Result < WorkItemResult < B > , FatalError > {
1009
1004
for ( module, wp) in import_only_modules {
@@ -1015,7 +1010,6 @@ fn execute_fat_lto_work_item<B: ExtraBackendMethods>(
1015
1010
exported_symbols_for_lto,
1016
1011
each_linked_rlib_for_lto,
1017
1012
needs_fat_lto,
1018
- autodiff,
1019
1013
) ?;
1020
1014
let module = B :: codegen ( cgcx, module, module_config) ?;
1021
1015
Ok ( WorkItemResult :: Finished ( module) )
@@ -1119,7 +1113,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
1119
1113
backend : B ,
1120
1114
tcx : TyCtxt < ' _ > ,
1121
1115
crate_info : & CrateInfo ,
1122
- autodiff_items : & [ AutoDiffItem ] ,
1123
1116
shared_emitter : SharedEmitter ,
1124
1117
codegen_worker_send : Sender < CguMessage > ,
1125
1118
coordinator_receive : Receiver < Box < dyn Any + Send > > ,
@@ -1129,7 +1122,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
1129
1122
) -> thread:: JoinHandle < Result < CompiledModules , ( ) > > {
1130
1123
let coordinator_send = tx_to_llvm_workers;
1131
1124
let sess = tcx. sess ;
1132
- let autodiff_items = autodiff_items. to_vec ( ) ;
1133
1125
1134
1126
let mut each_linked_rlib_for_lto = Vec :: new ( ) ;
1135
1127
let mut each_linked_rlib_file_for_lto = Vec :: new ( ) ;
@@ -1464,19 +1456,13 @@ fn start_executing_work<B: ExtraBackendMethods>(
1464
1456
each_linked_rlib_for_lto : each_linked_rlib_file_for_lto,
1465
1457
needs_fat_lto,
1466
1458
import_only_modules,
1467
- autodiff : autodiff_items. clone ( ) ,
1468
1459
} ,
1469
1460
0 ,
1470
1461
) ) ;
1471
1462
if cgcx. parallel {
1472
1463
helper. request_token ( ) ;
1473
1464
}
1474
1465
} else {
1475
- if !autodiff_items. is_empty ( ) {
1476
- let dcx = cgcx. create_dcx ( ) ;
1477
- dcx. handle ( ) . emit_fatal ( AutodiffWithoutLto { } ) ;
1478
- }
1479
-
1480
1466
for ( work, cost) in generate_thin_lto_work (
1481
1467
& cgcx,
1482
1468
& exported_symbols_for_lto,
@@ -1827,7 +1813,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
1827
1813
each_linked_rlib_for_lto,
1828
1814
needs_fat_lto,
1829
1815
import_only_modules,
1830
- autodiff,
1831
1816
} => {
1832
1817
let _timer = cgcx
1833
1818
. prof
@@ -1838,7 +1823,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
1838
1823
& each_linked_rlib_for_lto,
1839
1824
needs_fat_lto,
1840
1825
import_only_modules,
1841
- autodiff,
1842
1826
module_config,
1843
1827
)
1844
1828
}
0 commit comments