[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 30 13:12:00 PDT 2018


Hahnfeld added a comment.

In https://reviews.llvm.org/D50845#1219853, @tra wrote:

> In https://reviews.llvm.org/D50845#1219819, @Hahnfeld wrote:
>
> > Ok, the top preprocessor condition for that function is `#ifndef __SSE2_MATH__` - the exact same macro that was part of the motivation. Can you please test compiling a simple C file (including `math.h`) with `-mno-sse`? My guess would be that this is broken as well.
> >  If yes I'm fine with reverting because I need to teach Clang to allow anonymous unions in type specifiers to make that weird system header work with this patch.
>
>
> It compiles fine. The code that causes the problem is also conditional on `!defined __NO_MATH_INLINES` and it's always defined for X86, so compilation only breaks for when we compile for NVPTX.


(which references a bug fixed in 2010 IIRC).

> Still, the issue seems to be way too hairy for one-line fix, so I'll proceed with the unroll if you don't beat me to it.

Please go ahead. You'll probably get conflicts because of https://reviews.llvm.org/D51446, but removing `InitializePredefinedAuxMacros` and the new test completely should do.


Repository:
  rL LLVM

https://reviews.llvm.org/D50845





More information about the cfe-commits mailing list