aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2018-08-25 13:42:40 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2018-08-25 13:42:40 +0000
commit931939bf922b45ad8c00e6a0b36d927e42b51661 (patch)
tree9ea1b929d159061137d3e1bfe44a479f117b90b4 /llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
parent7ded6a909bb8baddeee706f5591ecec601270758 (diff)
downloadllvm-931939bf922b45ad8c00e6a0b36d927e42b51661.zip
llvm-931939bf922b45ad8c00e6a0b36d927e42b51661.tar.gz
llvm-931939bf922b45ad8c00e6a0b36d927e42b51661.tar.bz2
[CUDA/OpenMP] Define only some host macros during device compilation
When compiling CUDA or OpenMP device code Clang parses header files that expect certain predefined macros from the host architecture. To make this work the compiler passes the host triple via the -aux-triple argument and (until now) pulls in all macros for that "auxiliary triple" unconditionally. However this results in defines like __SSE_MATH__ that will trigger inline assembly making use of the "advertised" target features. See the discussion of D47849 and PR38464 for a detailed explanation of the encountered problems. Instead of blacklisting "known bad" examples this patch starts adding defines that are needed for certain headers like bits/wordsize.h and bits/mathinline.h. The disadvantage of this approach is that it decouples the definitions from their target toolchain. However in my opinion it's more important to keep definitions for one header close together. For one this will include a clear documentation why these particular defines are needed. Furthermore it simplifies maintenance because adding defines for a new header or support for a new aux-triple only needs to touch one piece of code. Differential Revision: https://reviews.llvm.org/D50845 llvm-svn: 340681
Diffstat (limited to 'llvm/lib/Transforms/Utils/DemoteRegToStack.cpp')
0 files changed, 0 insertions, 0 deletions