Remove inlining for autodiff handling

This commit is contained in:
Marcelo Domínguez
2025-08-14 15:29:37 +00:00
parent 250d77e5d7
commit c9c1c17128
2 changed files with 21 additions and 19 deletions

View File

@@ -10,10 +10,9 @@ use tracing::debug;
use crate::builder::{Builder, PlaceRef, UNNAMED};
use crate::context::SimpleCx;
use crate::declare::declare_simple_fn;
use crate::llvm::AttributePlace::Function;
use crate::llvm;
use crate::llvm::{Metadata, True, Type};
use crate::value::Value;
use crate::{attributes, llvm};
pub(crate) fn adjust_activity_to_abi<'tcx>(
tcx: TyCtxt<'tcx>,
@@ -308,11 +307,6 @@ pub(crate) fn generate_enzyme_call<'ll, 'tcx>(
enzyme_ty,
);
// Otherwise LLVM might inline our temporary code before the enzyme pass has a chance to
// do it's work.
let attr = llvm::AttributeKind::NoInline.create_attr(cx.llcx);
attributes::apply_to_llfn(ad_fn, Function, &[attr]);
let num_args = llvm::LLVMCountParams(&fn_to_diff);
let mut args = Vec::with_capacity(num_args as usize + 1);
args.push(fn_to_diff);