Go to file
Jonas Hahnfeld 931939bf92 [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
2018-08-25 13:42:40 +00:00
clang [CUDA/OpenMP] Define only some host macros during device compilation 2018-08-25 13:42:40 +00:00
clang-tools-extra [clang-doc] Fix memory leaks 2018-08-24 16:43:46 +00:00
compiler-rt [scudo] Replace eraseHeader with compareExchangeHeader for Quarantined chunks 2018-08-24 18:21:32 +00:00
debuginfo-tests Revert "(Retry) Add a basic integration test for C++ smart pointers" 2018-08-20 19:53:33 +00:00
libclc amdgcn: Use __constant AS for amdgcn builtins. 2018-08-03 15:14:08 +00:00
libcxx [libc++] Fix handling of negated character classes in regex 2018-08-24 14:10:28 +00:00
libcxxabi Port my recent changes from LLVM copy of the demangler: 2018-08-24 23:30:26 +00:00
libunwind NFC: Test commit access 2018-08-16 16:55:07 +00:00
lld [Common] Discard the temp file while keeping the memory mapping open, on errors 2018-08-24 18:36:42 +00:00
lldb Disable exceptions for TestDataFormatterLibcxxOptional.py 2018-08-25 01:25:24 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [CodeGen] Set FrameSetup/FrameDestroy on BUNDLE instructions 2018-08-25 11:26:17 +00:00
openmp [OpenMP] Remove deprecated/obsolete MIC attributes from headers 2018-08-24 21:34:10 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [AST] Adapt Polly to AnalysisSetTracker changes. NFC. 2018-08-17 19:31:41 +00:00
README.md

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.