[all-commits] [llvm/llvm-project] 12c90b: [LinkerWrapper] Handle AMDGPU Target-IDs correctly...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Jan 18 07:45:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 12c90bd612fe7eb9e991bbfce8ca0ec43a3caccb
      https://github.com/llvm/llvm-project/commit/12c90bd612fe7eb9e991bbfce8ca0ec43a3caccb
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-01-18 (Thu, 18 Jan 2024)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/amdgpu-openmp-toolchain.c
    M clang/test/Driver/linker-wrapper.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    M llvm/include/llvm/Object/OffloadBinary.h
    M llvm/lib/Object/OffloadBinary.cpp

  Log Message:
  -----------
  [LinkerWrapper] Handle AMDGPU Target-IDs correctly when linking (#78359)

Summary:
The linker wrapper's job is to sort various embedded inputs into a list
of files that participate in a single link job. So far, this has been
completely 1-to-1, that is, each input file participates in exactly one
link job. However, support for AMD's target-id requires that one input
file may participate in multiple link jobs. For example, if given a
`gfx90a` static library and a `gfx90a:xnack+` object file input, we
should link the gfx90a` target into the `gfx90a:xnack+` job. These are
considered separate CPUs that can be mutually linked more or less.

This patch adds the necessary logic to make this happen. It primarily
reworks the logic to copy relevant input files into a separate list. So,
it moves construction of the final list of link jobs into the extraction
phase. We also need to copy the files in the case that it is needed more
than once, as the entire workflow expects ownership of said file.




More information about the All-commits mailing list