[all-commits] [llvm/llvm-project] 1c6cec: [libclc] Suppress data-layout warnings during link...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Tue Feb 18 04:06:38 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c6cecdbdd2470292ce0b508922d807e3100f85c
      https://github.com/llvm/llvm-project/commit/1c6cecdbdd2470292ce0b508922d807e3100f85c
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2025-02-18 (Tue, 18 Feb 2025)

  Changed paths:
    M libclc/amdgcn/lib/cl_khr_int64_extended_atomics/minmax_helpers.ll
    M libclc/cmake/modules/AddLibclc.cmake
    M libclc/r600/lib/image/get_image_attributes_impl.ll
    M libclc/r600/lib/image/read_image_impl.ll
    M libclc/r600/lib/image/write_image_impl.ll

  Log Message:
  -----------
  [libclc] Suppress data-layout warnings during linking (#127532)

libclc uses llvm-link to link together all of the individually built
libclc builtins files into one module. Some of these builtins files are
compiled from source by clang whilst others are converted from LLVM IR
directly to bytecode.

When llvm-link links a 'source' module into a 'destination' module, it
warns if the two modules have differing data layouts.

The LLVM IR files libclc links either have no data layout (shared
submodule files) or an explicit data layout in the case of certain
amdgcn/r600 files.

The warnings are very noisy and largely inconsequential. We can suppress
them exploiting a specific behaviours exhibited by llvm-link. When the
destination module has no data layout, it is given the source module's
data layout. Thus, if we link together all IR files first, followed by
the clang-compiled modules, 99% of the warnings are suppressed as they
arose from linking an empty data layout into a non-empty one.

The remaining warnings came from the amdgcn and r600 targets. Some of
these were because the data layouts were out of date compared with what
clang currently produced, so those could have been updated.

However, even with those changes and by grouping the IR files together,
the linker may still link explicit data layouts with empty ones
depending on the order the IR files are processed.

As it happens, the data layouts aren't essential. With the changes to
the link line we can rely on those IR files receiving the correct data
layout from the clang-compiled modules later in the link line. This also
makes the previously AMDGPU-specific IR files available to be used by
all targets in a generic capacity in the future.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list