@@ -24,9 +24,8 @@ use crate::back::write::{
2424 self , CodegenDiagnosticsStage , DiagnosticHandlers , bitcode_section_name, save_temp_bitcode,
2525} ;
2626use crate :: errors:: { LlvmError , LtoBitcodeFromRlib } ;
27- use crate :: llvm:: AttributePlace :: Function ;
2827use crate :: llvm:: { self , build_string} ;
29- use crate :: { LlvmCodegenBackend , ModuleLlvm , SimpleCx , attributes } ;
28+ use crate :: { LlvmCodegenBackend , ModuleLlvm , SimpleCx } ;
3029
3130/// We keep track of the computed LTO cache keys from the previous
3231/// session to determine which CGUs we can reuse.
@@ -593,31 +592,6 @@ pub(crate) fn run_pass_manager(
593592 }
594593
595594 if cfg ! ( llvm_enzyme) && enable_ad && !thin {
596- let cx =
597- SimpleCx :: new ( module. module_llvm . llmod ( ) , & module. module_llvm . llcx , cgcx. pointer_size ) ;
598-
599- for function in cx. get_functions ( ) {
600- let enzyme_marker = "enzyme_marker" ;
601- if attributes:: has_string_attr ( function, enzyme_marker) {
602- // Sanity check: Ensure 'noinline' is present before replacing it.
603- assert ! (
604- attributes:: has_attr( function, Function , llvm:: AttributeKind :: NoInline ) ,
605- "Expected __enzyme function to have 'noinline' before adding 'alwaysinline'"
606- ) ;
607-
608- attributes:: remove_from_llfn ( function, Function , llvm:: AttributeKind :: NoInline ) ;
609- attributes:: remove_string_attr_from_llfn ( function, enzyme_marker) ;
610-
611- assert ! (
612- !attributes:: has_string_attr( function, enzyme_marker) ,
613- "Expected function to not have 'enzyme_marker'"
614- ) ;
615-
616- let always_inline = llvm:: AttributeKind :: AlwaysInline . create_attr ( cx. llcx ) ;
617- attributes:: apply_to_llfn ( function, Function , & [ always_inline] ) ;
618- }
619- }
620-
621595 let opt_stage = llvm:: OptStage :: FatLTO ;
622596 let stage = write:: AutodiffStage :: PostAD ;
623597 if !config. autodiff . contains ( & config:: AutoDiff :: NoPostopt ) {
0 commit comments