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

Guansong Zhang via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 5 12:29:17 PDT 2018


guansong added a comment.



In https://reviews.llvm.org/D44992#1058783, @Hahnfeld wrote:

> 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.


Currently we only enable the bc file path when we specified on the cmake command line with these flags -DLIBOMPTARGET_NVPTX_CUDA_COMPILER and -DLIBOMPTARGET_NVPTX_SELECTED_BC_LINKER. What we need is to check those compiler and linker's llvm version,  and then test that llvm version here.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D44992





More information about the Openmp-commits mailing list