[all-commits] [llvm/llvm-project] 4593e4: AMDGPU: Teach toolchain to link rocm device libs

Matt Arsenault via All-commits all-commits at lists.llvm.org
Fri Apr 10 10:39:26 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4593e4131affa84e61d7b6844be409ba46d29f11
      https://github.com/llvm/llvm-project/commit/4593e4131affa84e61d7b6844be409ba46d29f11
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2020-04-10 (Fri, 10 Apr 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.h
    M clang/lib/Driver/ToolChains/HIP.cpp
    M clang/lib/Driver/ToolChains/HIP.h
    M clang/test/CodeGenOpenCL/amdgpu-debug-info-pointer-address-space.cl
    M clang/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl
    A clang/test/Driver/Inputs/rocm-device-libs/lib/hip.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/ockl.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_correctly_rounded_sqrt_off.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_correctly_rounded_sqrt_on.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_daz_opt_off.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_daz_opt_on.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_finite_only_off.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_finite_only_on.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_isa_version_1010.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_isa_version_1011.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_isa_version_1012.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_isa_version_803.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_isa_version_900.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_unsafe_math_off.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_unsafe_math_on.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_wavefrontsize64_off.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/oclc_wavefrontsize64_on.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/ocml.amdgcn.bc
    A clang/test/Driver/Inputs/rocm-device-libs/lib/opencl.amdgcn.bc
    M clang/test/Driver/amdgpu-visibility.cl
    A clang/test/Driver/rocm-detect.cl
    A clang/test/Driver/rocm-device-libs.cl
    A clang/test/Driver/rocm-not-found.cl
    M llvm/include/llvm/Support/TargetParser.h
    M llvm/lib/Support/TargetParser.cpp

  Log Message:
  -----------
  AMDGPU: Teach toolchain to link rocm device libs

Currently the library is separately linked, but this isn't correct to
implement fast math flags correctly. Each module should get the
version of the library appropriate for its combination of fast math
and related flags, with the attributes propagated into its functions
and internalized.

HIP already maintains the list of libraries, but this is not used for
OpenCL. Unfortunately, HIP uses a separate --hip-device-lib argument,
despite both languages using the same bitcode library. Eventually
these two searches need to be merged.

An additional problem is there are 3 different locations the libraries
are installed, depending on which build is used. This also needs to be
consolidated (or at least the search logic needs to deal with this
unnecessary complexity).




More information about the All-commits mailing list