@@ -233,20 +233,8 @@ mod llvm_enzyme {
233
233
. filter ( |a| * * a == DiffActivity :: Active || * * a == DiffActivity :: ActiveOnly )
234
234
. count ( ) as u32 ;
235
235
let ( d_sig, new_args, idents, errored) = gen_enzyme_decl ( ecx, & sig, & x, span) ;
236
- let new_decl_span = d_sig. span ;
237
236
let d_body = gen_enzyme_body (
238
- ecx,
239
- & x,
240
- n_active,
241
- & sig,
242
- & d_sig,
243
- primal,
244
- & new_args,
245
- span,
246
- sig_span,
247
- new_decl_span,
248
- idents,
249
- errored,
237
+ ecx, & x, n_active, & sig, & d_sig, primal, & new_args, span, sig_span, idents, errored,
250
238
) ;
251
239
let d_ident = first_ident ( & meta_item_vec[ 0 ] ) ;
252
240
@@ -440,12 +428,10 @@ mod llvm_enzyme {
440
428
441
429
/// We only want this function to type-check, since we will replace the body
442
430
/// later on llvm level. Using `loop {}` does not cover all return types anymore,
443
- /// so instead we build something that should pass. We also add a inline_asm
444
- /// line, as one more barrier for rustc to prevent inlining of this function.
445
- /// FIXME(ZuseZ4): We still have cases of incorrect inlining across modules, see
446
- /// <https://github.com/EnzymeAD/rust/issues/173>, so this isn't sufficient.
447
- /// It also triggers an Enzyme crash if we due to a bug ever try to differentiate
448
- /// this function (which should never happen, since it is only a placeholder).
431
+ /// so instead we manually build something that should pass the type checker.
432
+ /// We also add a inline_asm line, as one more barrier for rustc to prevent inlining
433
+ /// or const propagation. inline_asm will also triggers an Enzyme crash if due to another
434
+ /// bug would ever try to accidentially differentiate this placeholder function body.
449
435
/// Finally, we also add back_box usages of all input arguments, to prevent rustc
450
436
/// from optimizing any arguments away.
451
437
fn gen_enzyme_body (
@@ -458,7 +444,6 @@ mod llvm_enzyme {
458
444
new_names : & [ String ] ,
459
445
span : Span ,
460
446
sig_span : Span ,
461
- _new_decl_span : Span ,
462
447
idents : Vec < Ident > ,
463
448
errored : bool ,
464
449
) -> P < ast:: Block > {
0 commit comments