diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 8cef9e0644bb0..e3e94e440f694 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -37,7 +37,6 @@ features = ['override_allocator_on_supported_platforms'] check_only = ['rustc_driver_impl/check_only'] jemalloc = ['dep:tikv-jemalloc-sys'] llvm = ['rustc_driver_impl/llvm'] -llvm_enzyme = ['rustc_driver_impl/llvm_enzyme'] llvm_offload = ['rustc_driver_impl/llvm_offload'] max_level_info = ['rustc_driver_impl/max_level_info'] rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts'] diff --git a/compiler/rustc_builtin_macros/Cargo.toml b/compiler/rustc_builtin_macros/Cargo.toml index f5dbc4a0d7cbe..59f00728f7fda 100644 --- a/compiler/rustc_builtin_macros/Cargo.toml +++ b/compiler/rustc_builtin_macros/Cargo.toml @@ -35,5 +35,4 @@ tracing = "0.1" [features] # tidy-alphabetical-start -llvm_enzyme = [] # tidy-alphabetical-end diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index ec850cf7ab3d2..6680d1323a923 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -43,7 +43,6 @@ tracing = "0.1" [features] # tidy-alphabetical-start check_only = ["rustc_llvm/check_only"] -llvm_enzyme = [] llvm_offload = [] # tidy-alphabetical-end diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index b2d22876c1858..70d48def59e91 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -617,7 +617,7 @@ pub(crate) fn run_pass_manager( ); } - if cfg!(feature = "llvm_enzyme") && enable_ad && !thin { + if enable_ad && !thin { let opt_stage = llvm::OptStage::FatLTO; let stage = write::AutodiffStage::PostAD; if !config.autodiff.contains(&config::AutoDiff::NoPostopt) diff --git a/compiler/rustc_codegen_llvm/src/typetree.rs b/compiler/rustc_codegen_llvm/src/typetree.rs index 7c2e09227e46b..9988ccfaee052 100644 --- a/compiler/rustc_codegen_llvm/src/typetree.rs +++ b/compiler/rustc_codegen_llvm/src/typetree.rs @@ -75,15 +75,9 @@ enum TTLocation { Callsite, } -#[cfg_attr(not(feature = "llvm_enzyme"), allow(unused))] pub(crate) fn add_tt<'tcx, 'll>(cx: &FullCx<'ll, 'tcx>, fn_def: &'ll Value, tt: FncTree) { - // TypeTree processing uses functions from Enzyme, which we might not have available if we did - // not build this compiler with `llvm_enzyme`. This feature is not strictly necessary, but - // skipping this function increases the chance that Enzyme fails to compile some code. - // FIXME(autodiff): In the future we should conditionally run this function even without the - // `llvm_enzyme` feature, in case that libEnzyme was provided via rustup. - #[cfg(not(feature = "llvm_enzyme"))] - return; + // TypeTree processing uses functions from Enzyme. This feature is not strictly necessary, + // but skipping this function increases the chance that Enzyme fails to compile some code. let tcx = cx.tcx; if !tcx.sess.opts.unstable_opts.autodiff.contains(&rustc_session::config::AutoDiff::Enable) { diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml index aeb2063e76960..c7d3e4fae3fc5 100644 --- a/compiler/rustc_driver_impl/Cargo.toml +++ b/compiler/rustc_driver_impl/Cargo.toml @@ -58,7 +58,6 @@ ctrlc = "3.4.4" # tidy-alphabetical-start check_only = ['rustc_interface/check_only'] llvm = ['rustc_interface/llvm'] -llvm_enzyme = ['rustc_interface/llvm_enzyme'] llvm_offload = ['rustc_interface/llvm_offload'] max_level_info = ['rustc_log/max_level_info'] rustc_randomized_layouts = [ diff --git a/compiler/rustc_interface/Cargo.toml b/compiler/rustc_interface/Cargo.toml index 9c115736a3d4f..4a272867046b4 100644 --- a/compiler/rustc_interface/Cargo.toml +++ b/compiler/rustc_interface/Cargo.toml @@ -57,6 +57,5 @@ rustc_abi = { path = "../rustc_abi" } # tidy-alphabetical-start check_only = ['rustc_codegen_llvm?/check_only'] llvm = ['dep:rustc_codegen_llvm'] -llvm_enzyme = ['rustc_builtin_macros/llvm_enzyme', 'rustc_codegen_llvm/llvm_enzyme'] llvm_offload = ['rustc_codegen_llvm/llvm_offload'] # tidy-alphabetical-end diff --git a/library/core/Cargo.toml b/library/core/Cargo.toml index 5421b1d2a2652..3f5f9f454a99d 100644 --- a/library/core/Cargo.toml +++ b/library/core/Cargo.toml @@ -23,7 +23,6 @@ optimize_for_size = [] # Make `RefCell` store additional debugging information, which is printed out when # a borrow error occurs debug_refcell = [] -llvm_enzyme = [] [lints.rust.unexpected_cfgs] level = "warn" @@ -39,7 +38,6 @@ check-cfg = [ 'cfg(target_has_reliable_f16_math)', 'cfg(target_has_reliable_f128)', 'cfg(target_has_reliable_f128_math)', - 'cfg(llvm_enzyme)', # Prevents use of a static variable for providing platform specific RawOsError # functionality 'cfg(no_io_statics)', diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 4c433d4970cda..0ee89dee4d7fc 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -125,8 +125,6 @@ optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"] # a borrow error occurs debug_refcell = ["core/debug_refcell"] -llvm_enzyme = ["core/llvm_enzyme"] - # Enable using raw-dylib for Windows imports. # This will eventually be the default. windows_raw_dylib = ["windows-link/windows_raw_dylib"] diff --git a/library/sysroot/Cargo.toml b/library/sysroot/Cargo.toml index b2069ef6a613b..10562389d62d3 100644 --- a/library/sysroot/Cargo.toml +++ b/library/sysroot/Cargo.toml @@ -32,4 +32,3 @@ optimize_for_size = ["std/optimize_for_size"] panic-unwind = ["std/panic-unwind"] profiler = ["dep:profiler_builtins"] windows_raw_dylib = ["std/windows_raw_dylib"] -llvm_enzyme = ["std/llvm_enzyme"] diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 2c8e002123abf..e2710b4d7621c 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -849,9 +849,9 @@ impl Build { features.insert("compiler-builtins-mem"); } - if self.config.llvm_enzyme { - features.insert("llvm_enzyme"); - } + //if self.config.llvm_enzyme { + // features.insert("llvm_enzyme"); + //} features.into_iter().collect::>().join(" ") } @@ -873,9 +873,9 @@ impl Build { if (self.config.llvm_enabled(target) || kind == Kind::Check) && check("llvm") { features.push("llvm"); } - if self.config.llvm_enzyme { - features.push("llvm_enzyme"); - } + //if self.config.llvm_enzyme { + // features.push("llvm_enzyme"); + //} if self.config.llvm_offload { features.push("llvm_offload"); }