We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86dedf7 commit ab54904Copy full SHA for ab54904
compiler/rustc_codegen_llvm/src/back/write.rs
@@ -1069,6 +1069,12 @@ pub(crate) unsafe fn enzyme_ad(
1069
_ => unreachable!(),
1070
};
1071
let mut res: &Value = tmp.0;
1072
+ // res is getting wrapped, but we don't want the perf overhead of a fnc call indirection.
1073
+ // So we'll add an alwaysinline attribute to let llvm handle it for us.
1074
+ let always_inline = llvm::AttributeKind::AlwaysInline;
1075
+ let attr = llvm::LLVMRustCreateAttrNoValue(llcx, always_inline);
1076
+ llvm::LLVMRustAddFunctionAttributes(res, 9, &attr, 1);
1077
+
1078
let size_positions: Vec<usize> = tmp.1;
1079
1080
let f_return_type = LLVMGetReturnType(LLVMGlobalGetValueType(res));
0 commit comments