[all-commits] [llvm/llvm-project] 42eb54: [Clang] Put offloading globals in the `.llvm.rodat...

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Oct 28 07:18:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42eb54b7743df421af10ebe14b67bb79b46ecabb
      https://github.com/llvm/llvm-project/commit/42eb54b7743df421af10ebe14b67bb79b46ecabb
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M clang/test/CodeGenCUDA/offloading-entries.cu
    M llvm/lib/Frontend/Offloading/Utility.cpp

  Log Message:
  -----------
  [Clang] Put offloading globals in the `.llvm.rodata.offloading` section (#111890)

Summary:
For our offloading entries, we currently store all the string names of
kernels that the runtime will need to load from the target executable.
These are available via pointer in the `__tgt_offload_entry` struct,
however this makes it difficult to obtain from the object itself. This
patch simply puts the strings in a named section so they can be easily
queried.

The motivation behind this is that when the linker wrapper is doing
linking, it wants to know which kernels the host executable is calling.
We *could* get this already via the `.relaomp_offloading_entires`
section and trawling through the string table, but that's quite annoying
and not portable. The follow-up to this should be to make the linker
wrapper get a list of all used symbols the device link job should count
as "needed" so we can handle static linking more directly.



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