[all-commits] [llvm/llvm-project] 643c9b: [OpenMP] Make generating offloading entries more g...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Apr 29 06:15:00 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 643c9b22ef527be8532d7b75ccf64180fa060339
      https://github.com/llvm/llvm-project/commit/643c9b22ef527be8532d7b75ccf64180fa060339
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/CodeGen/CGOpenMPRuntime.h
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

  Log Message:
  -----------
  [OpenMP] Make generating offloading entries more generic

This patch moves the logic for generating the offloading entries to the
OpenMPIRBuilder. This makes it easier to re-use in other places, such as
for OpenMP support in Flang or using the same method for generating
offloading entires for other languages like Cuda.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D123460


  Commit: ca6bbe008512c9dc6a1ac242466a9d42288daff8
      https://github.com/llvm/llvm-project/commit/ca6bbe008512c9dc6a1ac242466a9d42288daff8
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang/include/clang/Driver/Action.h
    M clang/lib/Driver/Action.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp

  Log Message:
  -----------
  [OpenMP] Make clang argument handling for the new driver more generic

In preparation for accepting other offloading kinds with the new driver,
this patch makes the way we handle offloading actions more generic. A
new field to get the associated device action's toolchain is used rather
than manually iterating a list. This makes building the arguments easier
and makes sure that we doin't rely on any implicit ordering.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D123313


  Commit: 4e2b5a6693e299fcb8671d4dbb69c993d181b29f
      https://github.com/llvm/llvm-project/commit/4e2b5a6693e299fcb8671d4dbb69c993d181b29f
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp

  Log Message:
  -----------
  [Clang] Make enabling the new driver more generic

In preparation for allowing other offloading kinds to use the new driver
a new opt-in flag `-foffload-new-driver` is added. This is distinct from
the existing `-fopenmp-new-driver` because OpenMP will soon use the new
driver by default while the others should not.

Reviewed By: yaxunl, tra

Differential Revision: https://reviews.llvm.org/D123325


  Commit: c5e5b54350fecd4b44c60eb4e982c13de5307aee
      https://github.com/llvm/llvm-project/commit/c5e5b54350fecd4b44c60eb4e982c13de5307aee
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang/include/clang/Basic/Cuda.h
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/Driver/cuda-openmp-driver.cu
    M clang/test/Driver/cuda-phases.cu

  Log Message:
  -----------
  [CUDA] Add driver support for compiling CUDA with the new driver

This patch adds the basic support for the clang driver to compile and link CUDA
using the new offloading driver. This requires handling the CUDA offloading kind
and embedding the generated files into the host. This will allow us to link
OpenMP code with CUDA code in the linker wrapper. More support will be required
to create functional CUDA / HIP binaries using this method.

Depends on D120270 D120271 D120934

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D120272


Compare: https://github.com/llvm/llvm-project/compare/5b524da42f68...c5e5b54350fe


More information about the All-commits mailing list