| commit | 257b72758424f56103d38e3d016cfb6baa4da613 | [log] [tgz] |
|---|---|---|
| author | Nick Sarnie <nick.sarnie@intel.com> | Fri Apr 18 11:28:46 2025 -0400 |
| committer | GitHub <noreply@github.com> | Fri Apr 18 15:28:46 2025 +0000 |
| tree | 14611eaf35cceadbc2633369d90a6112297932ec | |
| parent | c016a65c180c8703d5bdb2a277bb1629df5517b6 [diff] |
[clang][Sema][SYCL] Fix MSVC STL usage on AMDGPU (#135979) The MSVC STL includes specializations of `_Is_memfunptr` for every function pointer type, including every calling convention. The problem is the AMDGPU target doesn't support the x86 `vectorcall` calling convention so clang sets it to the default CC. This ends up clashing with the already-existing overload for the default CC, so we get a duplicate definition error when including `type_traits` (which we heavily use in the SYCL STL) and compiling for AMDGPU on Windows. This doesn't happen for pure AMDGPU non-SYCL because it doesn't include the C++ STL, and it doesn't happen for CUDA/HIP because a similar workaround was done [here](https://github.com/llvm/llvm-project/commit/fa49c3a888e816969b5ed68cd5c47efc3eb9419f). I am not an expert in Sema, so I did a kinda of hardcoded fix, please let me know if there is a better way to fix this. As far as I can tell we can't do exactly the same fix that was done for CUDA because we can't differentiate between device and host code so easily. --------- Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.