[all-commits] [llvm/llvm-project] c9f573: [Analysis] Move TargetLibraryInfo data to TableGen...

Kai Nacke via All-commits all-commits at lists.llvm.org
Wed Nov 19 13:05:21 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9f573463ebd7b4e46da4877802f2364f700e54a
      https://github.com/llvm/llvm-project/commit/c9f573463ebd7b4e46da4877802f2364f700e54a
  Author: Kai Nacke <kai.peter.nacke at ibm.com>
  Date:   2025-11-19 (Wed, 19 Nov 2025)

  Changed paths:
    A llvm/include/llvm/Analysis/CMakeLists.txt
    R llvm/include/llvm/Analysis/TargetLibraryInfo.def
    M llvm/include/llvm/Analysis/TargetLibraryInfo.h
    A llvm/include/llvm/Analysis/TargetLibraryInfo.td
    A llvm/include/llvm/Analysis/TargetLibraryInfoImpl.td
    M llvm/include/llvm/CMakeLists.txt
    M llvm/include/llvm/TableGen/StringToOffsetTable.h
    M llvm/lib/Analysis/BranchProbabilityInfo.cpp
    M llvm/lib/Analysis/CMakeLists.txt
    M llvm/lib/Analysis/TargetLibraryInfo.cpp
    M llvm/lib/LTO/UpdateCompilerUsed.cpp
    M llvm/lib/TableGen/StringToOffsetTable.cpp
    M llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    A llvm/test/TableGen/TargetLibraryInfo.td
    M llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
    M llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
    M llvm/utils/TableGen/Basic/CMakeLists.txt
    A llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp

  Log Message:
  -----------
  [Analysis] Move TargetLibraryInfo data to TableGen (#165009)

The collection of library function names in TargetLibraryInfo faces
similar challenges as RuntimeLibCalls in the IR component. The number of
function names is large, there are numerous customizations based on the
triple (including alternate names), and there is a lot of replicated
data in the signature table.

The ultimate goal would be to capture all lbrary function related
information in a .td file. This PR brings the current .def file to
TableGen, almost as a 1:1 replacement. However, there are some
improvements which are not possible in the current implementation:

- the function names are now stored as a long string together with an
offset table.
- the table of signatures is now deduplicated, using an offset table for
access.

The size of the object file decreases about 34kB with these changes. The
hash table of all function names is still constructed dynamically. A
static table like for RuntimeLibCalls is the next logical step.

The main motivation for this change is that I have to add a large number
of custom names for z/OS (like in RuntimeLibCalls.td), and the current
infrastructur does not support this very well.



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