about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/lto.rs
diff options
context:
space:
mode:
authorManuel Drehwald <git@manuel.drehwald.info>2025-06-18 15:29:43 -0700
committerManuel Drehwald <git@manuel.drehwald.info>2025-07-18 16:24:00 -0700
commit634016478ec95c6ff933d32789e663ace78e8f82 (patch)
treec77b4ad839173bce2f3911cc860238323f7fb8d4 /compiler/rustc_codegen_llvm/src/back/lto.rs
parent42d6b0d8bcdc5a0dfd77fe2daac6f8a8f67ac6cd (diff)
downloadrust-634016478ec95c6ff933d32789e663ace78e8f82.tar.gz
rust-634016478ec95c6ff933d32789e663ace78e8f82.zip
add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/lto.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/lto.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs
index 655e1c95373..b050a69eece 100644
--- a/compiler/rustc_codegen_llvm/src/back/lto.rs
+++ b/compiler/rustc_codegen_llvm/src/back/lto.rs
@@ -668,6 +668,12 @@ pub(crate) fn run_pass_manager(
         write::llvm_optimize(cgcx, dcx, module, None, config, opt_level, opt_stage, stage)?;
     }
 
+    if enable_gpu && !thin {
+        let cx =
+            SimpleCx::new(module.module_llvm.llmod(), &module.module_llvm.llcx, cgcx.pointer_size);
+        crate::builder::gpu_offload::handle_gpu_code(cgcx, &cx);
+    }
+
     if cfg!(llvm_enzyme) && enable_ad && !thin {
         let cx =
             SimpleCx::new(module.module_llvm.llmod(), &module.module_llvm.llcx, cgcx.pointer_size);