[clang] [Clang][HIP] Add LLVM vendored device headers for `*-llvm` triple (PR #203980)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 15 12:46:17 PDT 2026


================
@@ -252,6 +252,12 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
   else
     Builder.defineMacro("__R600__");
 
+  // The 'llvm' environment selects the upstream, ROCm Device Library-free
+  // device runtime. Expose it so headers can route to builtin/libclc/libc
+  // backed implementations instead of the ockl/ocml functions.
+  if (getTriple().getEnvironment() == llvm::Triple::LLVM)
+    Builder.defineMacro("__AMDGCN_LLVM__");
----------------
arsenm wrote:

I'm trying to move towards amdgpu over amdgcn naming. Should this also be a more general llvm libc macro?

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


More information about the cfe-commits mailing list