[Openmp-commits] [PATCH] D83268: [OpenMP][NFC] Remove unused (always fixed) arguments

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 7 06:36:24 PDT 2020


jdoerfert marked an inline comment as done.
jdoerfert added a comment.

> I don't think gcc can be using this runtime library for nvptx.

Yes, and: We are (going to) use clang specific intrinsics to avoid CUDA (soon).

> Use of the new library with the previous version of the compiler.

Except that you cannot generally expect this to work. In our supported use case the library is kept as bitcode (LLVM-IR). Bitcode is not backward compatible. An old toolchain (clang, llvm-link, ...) cannot be fed new IR and be expected to work. So, we are already not able to give a stability guarantee here, why pretend we do. The bitcode runtime has to be kept in-sync with the toolchain.



================
Comment at: clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:42
-  /// *outlined_function, int16_t
-  /// IsOMPRuntimeInitialized);
   OMPRTL_NVPTX__kmpc_kernel_prepare_parallel,
----------------
JonChesterfield wrote:
> ABataev wrote:
> > I think, instead the optimizer can try to detect if the runtime library is used by the kernel and switch this flag to `0` if no runtime calls are used in the kernel. For non-SPMD mode in most cases, the runtime is required, but in some cases, it can be disabled.
> If we can detect that no runtime calls are used, we should be able to do better than passing a different argument. E.g. delete some setup calls.
> 
> Failing that, if we want to pass an argument which says 'actually don't do any work', it shouldn't be the same argument used to check whether the runtime has been initialised.
We can detect all we want but switching it *does not have any effect*.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83268/new/

https://reviews.llvm.org/D83268





More information about the Openmp-commits mailing list