about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/intrinsic.rs
diff options
context:
space:
mode:
authorKaran Janthe <karanjanthe@gmail.com>2025-08-23 21:56:56 +0000
committerKaran Janthe <karanjanthe@gmail.com>2025-09-19 04:02:19 +0000
commit375e14ef491ac7bfa701e269b2815625abf2fca6 (patch)
tree398d7a2d0dbe09de910c73061a84c210d55455b4 /compiler/rustc_codegen_llvm/src/intrinsic.rs
parente1258e79d6cb709b26ded97d32de6c55f355e2aa (diff)
downloadrust-375e14ef491ac7bfa701e269b2815625abf2fca6.tar.gz
rust-375e14ef491ac7bfa701e269b2815625abf2fca6.zip
Add TypeTree metadata attachment for autodiff
  - Add F128 support to TypeTree Kind enum
  - Implement TypeTree FFI bindings and conversion functions
  - Add typetree.rs module for metadata attachment to LLVM functions
  - Integrate TypeTree generation with autodiff intrinsic pipeline
  - Support scalar types: f32, f64, integers, f16, f128
  - Attach enzyme_type attributes as LLVM string metadata for Enzyme

Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/intrinsic.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/intrinsic.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs
index e7f4a357048..3254b318651 100644
--- a/compiler/rustc_codegen_llvm/src/intrinsic.rs
+++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs
@@ -1213,6 +1213,9 @@ fn codegen_autodiff<'ll, 'tcx>(
         &mut diff_attrs.input_activity,
     );
 
+    let fnc_tree =
+        rustc_middle::ty::fnc_typetrees(tcx, fn_source.ty(tcx, TypingEnv::fully_monomorphized()));
+
     // Build body
     generate_enzyme_call(
         bx,
@@ -1223,6 +1226,7 @@ fn codegen_autodiff<'ll, 'tcx>(
         &val_arr,
         diff_attrs.clone(),
         result,
+        fnc_tree,
     );
 }