Module llvm_enzyme

Source

Functions§

assure_mut_ref 🔒
expand 🔒
We expand the autodiff macro to generate a new placeholder function which passes type-checking and can be called by users. The function body of the placeholder function will later be replaced on LLVM-IR level, so the design of the body is less important and for now should just prevent early inlining and optimizations which alter the function signature. The exact signature of the generated function depends on the configuration provided by the user, but here is an example:
first_ident 🔒
from_ast 🔒
gen_enzyme_body 🔒
We only want this function to type-check, since we will replace the body later on llvm level. Using loop {} does not cover all return types anymore, so instead we manually build something that should pass the type checker. We also add a inline_asm line, as one more barrier for rustc to prevent inlining or const propagation. inline_asm will also triggers an Enzyme crash if due to another bug would ever try to accidentially differentiate this placeholder function body. Finally, we also add back_box usages of all input arguments, to prevent rustc from optimizing any arguments away.
gen_enzyme_decl 🔒
gen_primal_call 🔒
has_ret 🔒
init_body_helper 🔒
name 🔒
outer_normal_attr 🔒