[clang] [Clang] Fix __cpuidex conflict with other offloading targets (PR #157741)
Nick Sarnie via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 9 13:13:27 PDT 2025
================
@@ -348,7 +348,7 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
// In some cases, offloading will set the host as the aux triple and define the
// builtin. Given __has_builtin does not detect builtins on aux triples, we need
// to explicitly check for some offloading cases.
-#ifndef __NVPTX__
+#if !defined(__NVPTX__) && !defined(__AMDGPU__) && !defined(__SPIRV__)
----------------
sarnex wrote:
Another option is to add a `TARGET_OFFLOADING` macro or something and check that, let me know what you prefer.
https://github.com/llvm/llvm-project/pull/157741
More information about the cfe-commits
mailing list