diff options
| author | Manuel Drehwald <git@manuel.drehwald.info> | 2025-02-02 05:13:53 -0500 |
|---|---|---|
| committer | Manuel Drehwald <git@manuel.drehwald.info> | 2025-02-02 05:13:53 -0500 |
| commit | e47caa2810bc35655ca082836396e544436f5b54 (patch) | |
| tree | 353400858f938b44c5c14974528838d79975d333 | |
| parent | 199ef412c5ab80f4b1b5316de70b8f1e721c9648 (diff) | |
| download | rust-e47caa2810bc35655ca082836396e544436f5b54.tar.gz rust-e47caa2810bc35655ca082836396e544436f5b54.zip | |
run less code if cfg(llvm_enzyme) isn't used
| -rw-r--r-- | compiler/rustc_monomorphize/src/partitioning.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index d0edd58def3..3ef061195da 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -1179,11 +1179,15 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> MonoItemPartitio } } + #[cfg(not(llvm_enzyme))] + let autodiff_mono_items: Vec<_> = vec![]; + #[cfg(llvm_enzyme)] let mut autodiff_mono_items: Vec<_> = vec![]; let mono_items: DefIdSet = items .iter() .filter_map(|mono_item| match *mono_item { MonoItem::Fn(ref instance) => { + #[cfg(llvm_enzyme)] autodiff_mono_items.push((mono_item, instance)); Some(instance.def_id()) } |
