[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 16 08:17:55 PDT 2018
ABataev added a comment.
In https://reviews.llvm.org/D50845#1202550, @Hahnfeld wrote:
> In https://reviews.llvm.org/D50845#1202540, @ABataev wrote:
>
> > Maybe for device compilation we also should define `__NO_MATH_INLINES` and `__NO_STRING_INLINES` macros to disable inline assembly in glibc?
>
>
> The problem is that `__NO_MATH_INLINES` doesn't even avoid all inline assembly from `bits/mathinline.h` :-( incidentally Clang already defines `__NO_MATH_INLINES` for x86 (due to an old bug which has been fixed long ago) - and on CentOS we still have problems as described in PR38464.
>
> As a second thought: This might be valid for NVPTX, but I don't think it's a good idea for x86-like offloading targets - they might well profit from inline assembly code.
I'm not saying that we should define those macros for all targets, only for NVPTX. But still, it may disable some inline assembly for other architectures.
Repository:
rC Clang
https://reviews.llvm.org/D50845
More information about the cfe-commits
mailing list