[compiler-rt] [llvm] [PGO][AMDGPU] Add basic HIP offload PGO support (PR #177665)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 11:44:10 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
----------------
arsenm wrote:
This was in the device libs cmake build, if you remove the -nostdinc there you'll see it when amdhsaabi.h is included
https://github.com/llvm/llvm-project/pull/177665
More information about the llvm-commits
mailing list