[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 10:23:07 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:

This shouldn't be the case, we should fix it if so. The runtimes list specifies `compilet-rt` *after* `libc`, so I would expect its required dependencies to be completed in time to use them here.

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


More information about the llvm-commits mailing list