[compiler-rt] [llvm] [PGO][AMDGPU] Add basic HIP offload PGO support (PR #177665)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 12:03:04 PDT 2026


================
@@ -167,14 +179,62 @@ if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "amdgcn|nvptx")
   endif()
 endif()
 
+# AMDGPU bare-metal profile (offload PGO): InstrProfiling.c includes <string.h> and
+# <limits.h>. Without forcing the include path, the GPU runtimes build can pick up
+# the *host* glibc headers (e.g. /usr/include/string.h -> bits/libc-header-start.h),
+# which is wrong for --target=amdgcn-amd-amdhsa -ffreestanding and fails the build.
+# Additionally, LLVM-libc headers for the GPU triple are generated by hdrgen during the
----------------
jhuber6 wrote:

Oh, so it's not upstream? I wonder if it's the same problem here, if so we shouldn't have that upstream because building this upstream works fine as far as I can tell. Aren't the device-libs handled as an external project?

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


More information about the llvm-commits mailing list