Skip to content

Commit 8444294

Browse files
committed
remove unnecessary enzyme initialization
1 parent a7c78bc commit 8444294

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,13 +1099,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
10991099
// vs. copying a struct with mixed types requires different derivative handling.
11001100
// The TypeTree tells Enzyme exactly what memory layout to expect.
11011101
if let Some(tt) = tt {
1102-
crate::typetree::add_tt(
1103-
self.cx().llmod,
1104-
self.cx().llcx,
1105-
memcpy,
1106-
tt,
1107-
&self.cx().tcx.sess.opts.sysroot,
1108-
);
1102+
crate::typetree::add_tt(self.cx().llmod, self.cx().llcx, memcpy, tt);
11091103
}
11101104
}
11111105

compiler/rustc_codegen_llvm/src/builder/autodiff.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,7 @@ pub(crate) fn generate_enzyme_call<'ll, 'tcx>(
375375
);
376376

377377
if !fnc_tree.args.is_empty() || !fnc_tree.ret.0.is_empty() {
378-
crate::typetree::add_tt(
379-
cx.llmod,
380-
cx.llcx,
381-
fn_to_diff,
382-
fnc_tree,
383-
&builder.cx().tcx.sess.opts.sysroot,
384-
);
378+
crate::typetree::add_tt(cx.llmod, cx.llcx, fn_to_diff, fnc_tree);
385379
}
386380

387381
let call = builder.call(enzyme_ty, None, None, ad_fn, &args, None, None);

compiler/rustc_codegen_llvm/src/typetree.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ pub(crate) fn add_tt<'ll>(
6363
llcx: &'ll llvm::Context,
6464
fn_def: &'ll Value,
6565
tt: FncTree,
66-
sysroot: &rustc_session::config::Sysroot,
6766
) {
6867
let inputs = tt.args;
6968
let ret_tt: RustTypeTree = tt.ret;
@@ -76,8 +75,6 @@ pub(crate) fn add_tt<'ll>(
7675
let attr_name = "enzyme_type";
7776
let c_attr_name = CString::new(attr_name).unwrap();
7877

79-
drop(EnzymeWrapper::get_or_init(sysroot));
80-
8178
for (i, input) in inputs.iter().enumerate() {
8279
unsafe {
8380
let enzyme_tt = to_enzyme_typetree(input.clone(), llvm_data_layout, llcx);

0 commit comments

Comments
 (0)