[clang] [clang][CodeGen] Emit referenced __device__ definitions across incremental modules (PR #218784)

Aditya Sinha via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 06:13:27 PDT 2026


================
@@ -0,0 +1,16 @@
+// Tests that during incremental HIP device compilation an inline __device__
+// helper referenced by a kernel has its definition emitted into the device
+// module (rather than left as an external declaration). In incremental mode
+// device code objects are not linked together, so a referenced inline/internal
+// __device__ function must be re-emitted into the referencing module.
+
+// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -fincremental-extensions -emit-llvm -o - %s | FileCheck %s
----------------
AdityaSinha149 wrote:

We can't do this test in this PR because it needs a device compiler instance; the interpreter has to do a device compilation and then inspect the module. An HIP device instance needs the HIP device support that isn't part of this PR. Should i remove the test from this PR and complete it in a follow-up PR where HIP parser will be completed?

https://github.com/llvm/llvm-project/pull/218784


More information about the cfe-commits mailing list