[Openmp-commits] [PATCH] D44992: [OpenMP] enable bc file compilation using the latest clang

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 5 12:07:32 PDT 2018


Hahnfeld added a comment.

In https://reviews.llvm.org/D44992#1058770, @guansong wrote:

> In https://reviews.llvm.org/D44992#1058469, @Hahnfeld wrote:
>
> > In https://reviews.llvm.org/D44992#1058461, @guansong wrote:
> >
> > > I don't think this is a regression through, as it is broken right now unless one uses an older (less 4.0) clang.
> >
> >
> > ... which is enough to satisfy the definition of a regression. Yes, Clang also regressed but that's no excuse to regress the runtime library. Please revert this change or let me know if you can't and I'll do it.
>
>
> I can add this flag conditionally as you suggested, how about something like this? where we check llvm version?
>
>   # Set flags for Clang cuda compilation.  Only Clang is supported because there is
>   # no other compiler capable of generating bitcode from cuda sources.
>   if (LLVM_VERSION_MAJOR GREATER 6)
>     set(CUDA_FLAGS
>       -emit-llvm
>       -fcuda-rdc
>       -O1
>       -Xclang -target-feature
>       -Xclang +${CUDA_PTX_VERSION}
>       --cuda-device-only
>       -DOMPTARGET_NVPTX_TEST=0 -DOMPTARGET_NVPTX_DEBUG=0
>       )
>   else()
>     set(CUDA_FLAGS
>       -emit-llvm
>       -O1
>       -Xclang -target-feature
>       -Xclang +${CUDA_PTX_VERSION}
>       --cuda-device-only
>       -DOMPTARGET_NVPTX_TEST=0 -DOMPTARGET_NVPTX_DEBUG=0
>       )
>   endif()
>   
>   


No, it needs to be a compiler check. `LLVM_VERSION` won't be set if building `openmp` standalone.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D44992





More information about the Openmp-commits mailing list