Skip to content
  1. Apr 07, 2022
    • Michael Kruse's avatar
      [libomptarget] Add device RTL to regression test dependencies. · 7fa7b0cb
      Michael Kruse authored
      In a clean build directory, `check-openmp` or `check-libomptarget` will fail because of missing device RTL .bc files. Ensure that the new targets new custom targets `omptarget.devicertl.nvptx` and `omptarget.devicertl.amdgpu` (corresponding to the plugin rtl targets `omptarget.rtl.cuda`, respectively `omptarget.rlt.amdgpu` ) are dependencies of the regression tests.
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D123177
      7fa7b0cb
  2. Mar 29, 2022
  3. Mar 22, 2022
    • Joseph Huber's avatar
      [OpenMP] Manually unroll the argument copy loop · a619072c
      Joseph Huber authored
      The unroll pragma did not properly work as the loop bound was not known
      when we optimize the runtime and we then added a "unroll disable"
      metadata which prevented unrolling later when the bounds were known.
      For now we manually unroll to make sure up to 16 elements are handled
      nicely. This helps optimizations to look through the argument passing.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D109164
      a619072c
  4. Mar 06, 2022
  5. Mar 04, 2022
    • Joseph Huber's avatar
      [Libomptarget] Work around bug in initialization of libomptarget · e2dcc221
      Joseph Huber authored
      Libomptarget uses some shared variables to track certain internal stated
      in the runtime. This causes problems when we have code that contains no
      OpenMP kernels. These variables are normally initialized upon kernel
      entry, but if there are no kernels we will see no initialization.
      Currently we load the runtime into each source file when not running in
      LTO mode, so these variables will be erroneously considered undefined or
      dead and removed, causing miscompiles. This patch temporarily works
      around the most obvious case, but others still exhibit this problem. We
      will need to fix this more soundly later.
      
      Fixes #54208.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D121007
      e2dcc221
  6. Mar 03, 2022
  7. Mar 02, 2022
  8. Feb 23, 2022
  9. Feb 18, 2022
  10. Feb 16, 2022
  11. Feb 14, 2022
    • Joseph Huber's avatar
      [Libomptarget][NFC] Remove constexpr to hide warnings · 48e3dcec
      Joseph Huber authored
      Currently whenever we compile the device runtime we get the following
      'Mapping.cpp:32:32: warning: inline function '_OMP::impl::getGridValue'
      is not defined [-Wundefined-inline]' warning. This can be silenced by
      removing the constexpr attribute for this function. Doing this doesn't
      change the generated bitcode at all but prevents the screen from getting
      filled with warnings whenver we build the runtime.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D119747
      48e3dcec
  12. Feb 10, 2022
  13. Feb 08, 2022
    • Joseph Huber's avatar
      [Libomptarget] Add header files as a dependency to CMake target · 99d72ebd
      Joseph Huber authored
      This patch manually adds the runtime include files to the list of
      dependencies when we build the bitcode runtime library. Previously if
      only the header was changed we would not recompile the source files.
      The solution used here isn't optimal because every source file not has a
      dependency on each header file regardless of if it was actually used by
      that file.
      
      Reviewed By: tianshilei1992
      
      Differential Revision: https://reviews.llvm.org/D119254
      99d72ebd
  14. Feb 07, 2022
    • Joseph Huber's avatar
      [Libomptarget] Replace Value RAII with default value · d28051c4
      Joseph Huber authored
      This patch replaces the ValueRAII pointer with a default 'nullptr'
      value. Previously this was initialized as a reference to an existing
      variable. The use of this variable caused overhead as the compiler could
      not look through the uses and determine that it was unused if 'Active'
      was not set. Because of this accesses to the variable would be left in
      the runtime once compiled.
      
      Fixes #53641
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D119187
      d28051c4
  15. Feb 04, 2022
    • Joseph Huber's avatar
      [OpenMP] Completely remove old device runtime · 034adaf5
      Joseph Huber authored
      This patch completely removes the old OpenMP device runtime. Previously,
      the old runtime had the prefix `libomptarget-new-` and the old runtime
      was simply called `libomptarget-`. This patch makes the formerly new
      runtime the only runtime available. The entire project has been deleted,
      and all references to the `libomptarget-new` runtime has been replaced
      with `libomptarget-`.
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D118934
      034adaf5
  16. Feb 01, 2022
  17. Jan 31, 2022
  18. Jan 28, 2022
  19. Jan 27, 2022
  20. Jan 21, 2022
    • Joseph Huber's avatar
      [Libomptarget] Change visibility to hidden for device RTL · 26feef08
      Joseph Huber authored
      This patch changes the visibility for all construct in the new device
      RTL to be hidden by default. This is done after the changes introduced
      in D117806 changed the visibility from being hidden by default for all
      device compilations. This asserts that the visibility for the device
      runtime library will be hidden except for the internal environment
      variable. This is done to aid optimization and linking of the device
      library.
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D117807
      26feef08
  21. Jan 20, 2022
    • Joseph Huber's avatar
      [OpenMP] Expand short verisions of OpenMP offloading triples · 28d71860
      Joseph Huber authored
      The OpenMP offloading libraries are built with fixed triples and linked
      in during compile time. This would cause un-helpful errors if the user
      passed in the wrong expansion of the triple used for the bitcode
      library. because we only support these triples for OpenMP offloading we
      can normalize them to the full verion used in the bitcode library.
      
      Reviewed By: jdoerfert, JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D117634
      28d71860
  22. Jan 19, 2022
    • Joseph Huber's avatar
      [Libomptarget] Fix external visibility for internal variables · 4863fed9
      Joseph Huber authored
      After the changes in D117362 made variables declared inside of a target
      declare directive visible outside the plugin, some variables inside the
      runtime were given visiblity that conflicted with their address space
      type. This caused problems when shared or local memory was made
      externally visible. This patch fixes this issue by making these
      varialbes static within the module, therefore limiting their visibility
      to being internal.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D117526
      4863fed9
  23. Jan 18, 2022
  24. Jan 17, 2022
    • Joseph Huber's avatar
      [Libomptarget] Add `cold` to KeepAlive attributes · 4869a22d
      Joseph Huber authored
      This patch adds the `cold` attribute to the keepAlive functions in the
      RTL. This dummy function exists to keep certain RTL calls alive without
      them being optimized out, but it is never called and can be declared
      cold. This also helps some erroneous remarks being given on this
      function because it has weak linkage and cannot be made internal.
      
      Reviewed By: tianshilei1992
      
      Differential Revision: https://reviews.llvm.org/D117513
      4869a22d
  25. Jan 13, 2022
  26. Dec 27, 2021
    • Joseph Huber's avatar
      [OpenMP][FIX] Change globalization alignment to 16 · 7cdaa5a9
      Joseph Huber authored
      This patch changes the default aligntment from 8 to 16, and encodes this
      information in the `__kmpc_alloc_shared` runtime call to communicate it
      to the HeapToStack pass. The previous alignment of 8 was not sufficient
      for the maximum size of primitive types on 64-bit systems, and needs to
      be increaesd. This reduces the amount of space availible in the data
      sharing stack, so this implementation will need to be improved later to
      include the alignment requirements in the allocation call, and use it
      properly in the data sharing stack in the runtime.
      
      Depends on D115888
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D115971
      7cdaa5a9
  27. Dec 09, 2021
    • Joseph Huber's avatar
      [OpenMP][FIX] Pass the num_threads value directly to parallel_51 · bc9c4d72
      Joseph Huber authored
      The problem with the old scheme is that we would need to keep track of
      the "next region" and reset the num_threads value after it. The new RT
      doesn't do it and an assertion is triggered. The old RT doesn't do it
      either, I haven't tested it but I assume a num_threads clause might
      impact multiple parallel regions "accidentally". Further, in SPMD mode
      num_threads was simply ignored, for some reason beyond me.
      
      In any case, parallel_51 is designed to take the clause value directly,
      so let's do that instead.
      
      Reviewed By: tianshilei1992
      
      Differential Revision: https://reviews.llvm.org/D113623
      bc9c4d72
  28. Nov 30, 2021
  29. Nov 16, 2021
    • Joseph Huber's avatar
      [OpenMP] Fix initializer not working on AMDGPU · 374cd0fb
      Joseph Huber authored
      The RAII class used for debugging RTL entry used a shared variable to
      keep track of the current depth. This used a global initializer, which
      isn't supported on AMDGPU. This patch removes the initializer and
      instead sets it to zero when the state is initialized in the runtime.
      
      Reviewed By: jdoerfert, JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D113963
      374cd0fb
  30. Nov 12, 2021
  31. Nov 10, 2021
    • Jon Chesterfield's avatar
      [OpenMP] Lower printf to __llvm_omp_vprintf · 27177b82
      Jon Chesterfield authored
      Extension of D112504. Lower amdgpu printf to `__llvm_omp_vprintf`
      which takes the same const char*, void* arguments as cuda vprintf and also
      passes the size of the void* alloca which will be needed by a non-stub
      implementation of `__llvm_omp_vprintf` for amdgpu.
      
      This removes the amdgpu link error on any printf in a target region in favour
      of silently compiling code that doesn't print anything to stdout.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D112680
      27177b82
  32. Nov 09, 2021
  33. Nov 08, 2021
Loading