Skip to content

Commit f49db89

Browse files
committed
noinline wait for sometimes
1 parent 5d878a4 commit f49db89

File tree

1 file changed

+4
-6
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+4
-6
lines changed

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,11 @@ pub(crate) fn run_pass_manager(
599599
for function in cx.get_functions() {
600600
let enzyme_marker = "enzyme_marker";
601601
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-
);
602+
// Remove 'noinline' if present (it should be there in most cases)
603+
if attributes::has_attr(function, Function, llvm::AttributeKind::NoInline) {
604+
attributes::remove_from_llfn(function, Function, llvm::AttributeKind::NoInline);
605+
}
607606

608-
attributes::remove_from_llfn(function, Function, llvm::AttributeKind::NoInline);
609607
attributes::remove_string_attr_from_llfn(function, enzyme_marker);
610608

611609
assert!(

0 commit comments

Comments
 (0)