-
Notifications
You must be signed in to change notification settings - Fork 15k
[Analysis] Move TargetLibraryInfo data to TableGen #165009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
@llvm/pr-subscribers-llvm-analysis @llvm/pr-subscribers-llvm-transforms Author: Kai Nacke (redstar) ChangesThe 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 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. Patch is 178.90 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/165009.diff 19 Files Affected:
diff --git a/llvm/include/llvm/Analysis/CMakeLists.txt b/llvm/include/llvm/Analysis/CMakeLists.txt
new file mode 100644
index 0000000000000..036f7ff00ce86
--- /dev/null
+++ b/llvm/include/llvm/Analysis/CMakeLists.txt
@@ -0,0 +1,3 @@
+set(LLVM_TARGET_DEFINITIONS TargetLibraryInfo.td)
+tablegen(LLVM TargetLibraryInfo.inc -gen-target-library-info)
+add_public_tablegen_target(analysis_gen)
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
deleted file mode 100644
index 014988299d37f..0000000000000
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def
+++ /dev/null
@@ -1,2698 +0,0 @@
-//===-- TargetLibraryInfo.def - Library information -------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This .def file will either fill in the enum definition or fill in the
-// string representation array definition for TargetLibraryInfo.
-// Which is defined depends on whether TLI_DEFINE_ENUM is defined or
-// TLI_DEFINE_STRING is defined. Only one should be defined at a time.
-
-// NOTE: The nofree attribute is added to Libfuncs which are not
-// listed as free or realloc functions in MemoryBuiltins.cpp
-//
-// When adding a function which frees memory include the LibFunc
-// in lib/Analysis/MemoryBuiltins.cpp "isLibFreeFunction".
-//
-// When adding a LibFunc which reallocates memory include the LibFunc
-// in lib/Analysis/MemoryBuiltins.cpp "AllocationFnData[]".
-
-#if (defined(TLI_DEFINE_ENUM) + \
- defined(TLI_DEFINE_STRING) + \
- defined(TLI_DEFINE_SIG) != 1)
-#error "Must define exactly one of TLI_DEFINE_ENUM, TLI_DEFINE_STRING, or TLI_DEFINE_SIG for TLI .def."
-#else
-// Exactly one of TLI_DEFINE_ENUM/STRING/SIG is defined.
-
-#if defined(TLI_DEFINE_ENUM)
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant) LibFunc_##enum_variant,
-#define TLI_DEFINE_STRING_INTERNAL(string_repr)
-#define TLI_DEFINE_SIG_INTERNAL(...)
-#elif defined(TLI_DEFINE_STRING)
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant)
-#define TLI_DEFINE_STRING_INTERNAL(string_repr) string_repr,
-#define TLI_DEFINE_SIG_INTERNAL(...)
-#else
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant)
-#define TLI_DEFINE_STRING_INTERNAL(string_repr)
-#define TLI_DEFINE_SIG_INTERNAL(...) { __VA_ARGS__ },
-#endif
-
-/// void *operator new(unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_int)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new(unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_int_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPAXIABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new(unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_longlong)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong)
-
-/// void *operator new(unsigned long long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_longlong_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPEAX_KAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong, Ptr)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAXABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32_int)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAXAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64_longlong)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, LLong)
-
-/// void *operator new[](unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_int)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new[](unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_int_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPAXIABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new[](unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_longlong)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong)
-
-/// void *operator new[](unsigned long long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_longlong_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPEAX_KAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong, Ptr)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAXABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32_int)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAXAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64_longlong)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, LLong)
-
-/// int _IO_getc(_IO_FILE * __fp);
-TLI_DEFINE_ENUM_INTERNAL(under_IO_getc)
-TLI_DEFINE_STRING_INTERNAL("_IO_getc")
-TLI_DEFINE_SIG_INTERNAL(Int, Ptr)
-
-/// int _IO_putc(int __c, _IO_FILE * __fp);
-TLI_DEFINE_ENUM_INTERNAL(under_IO_putc)
-TLI_DEFINE_STRING_INTERNAL("_IO_putc")
-TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPv)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPv")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus)
-
-/// void operator delete[](void*, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus, Ptr)
-
-/// void operator delete[](void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvj)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvj")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete[](void*, unsigned int, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int, Int)
-
-/// void operator delete[](void*, unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvm)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvm")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long)
-
-/// void operator delete[](void*, unsigned long, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long, Long)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPv)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPv")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus)
-
-/// void operator delete(void*, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus, Ptr)
-
-/// void operator delete(void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvj)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvj")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete(void*, unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int, Int)
-
-/// void operator delete(void*, unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvm)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvm")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long)
-
-/// void operator delete(void*, unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long, Long)
-
-/// void *operator new[](unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(Znaj)
-TLI_DEFINE_STRING_INTERNAL("_Znaj")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new[](unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnajRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new[](unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnajSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int)
-
-/// void *operator new[](unsigned int, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnajSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int, Ptr)
-
-/// void *operator new[](unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(Znam)
-TLI_DEFINE_STRING_INTERNAL("_Znam")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long)
-
-/// void *operator new[](unsigned long, __hot_cold_t)
-/// Currently this and other operator new interfaces that take a __hot_cold_t
-/// hint are supported by the open source version of tcmalloc, see:
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h
-/// and for the definition of the __hot_cold_t parameter see:
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h
-TLI_DEFINE_ENUM_INTERNAL(Znam12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_Znam12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Bool)
-
-/// void *operator new[](unsigned long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnamRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr)
-
-/// void *operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr, Bool)
-
-/// void *operator new[](unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long)
-
-/// void *operator new[](unsigned long, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Bool)
-
-/// void *operator new[](unsigned long, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr)
-
-/// void *operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr, Bool)
-
-/// void *operator new(unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(Znwj)
-TLI_DEFINE_STRING_INTERNAL("_Znwj")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new(unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnwjRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new(unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int)
-
-/// void *operator new(unsigned int, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnwjSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int, Ptr)
-
-/// void *operator new(unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(Znwm)
-TLI_DEFINE_STRING_INTERNAL("_Znwm")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long)
-
-/// void *operator new(unsigned long, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(Znwm12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_Znwm12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Bool)
-
-/// void *operator new(unsigned long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnwmRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr)
-
-/// void *operator new(unsigned long, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr, Bool)
-
-/// void *operator new(unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long)
-
-/// void *operator new(unsigned long, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Bool)
-
-/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr)
-
-/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr, Bool)
-
-/// The following are variants of operator new which return the actual size
-/// reserved by the allocator proposed in P0901R5 (Size feedback in operator new).
-/// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0901r5.html
-/// They are implemented by tcmalloc, see source at
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h
-
-/// __sized_ptr_t __size_returning_new(size_t size)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_hot_cold(size_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_hot_cold)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_hot_cold")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_aligned)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_aligned")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_aligned_hot_cold)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_aligned_hot_cold")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// double __acos_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(acos_finite)
-TLI_DEFINE_STRING_INTERNAL("__acos_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __acosf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(acosf_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// double __acosh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(acosh_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __acoshf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(acoshf_finite)
-TLI_DEFINE_STRING_INTERNAL("__acoshf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __acoshl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(acoshl_finite)
-TLI_DEFINE_STRING_INTERNAL("__acoshl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// long double __acosl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(acosl_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double __asin_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(asin_finite)
-TLI_DEFINE_STRING_INTERNAL("__asin_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __asinf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(asinf_finite)
-TLI_DEFINE_STRING_INTERNAL("__asinf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __asinl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(asinl_finite)
-TLI_DEFINE_STRING_INTERNAL("__asinl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double atan2_finite(double y, double x);
-TLI_DEFINE_ENUM_INTERNAL(atan2_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl, Dbl)
-
-/// float atan2f_finite(float y, float x);
-TLI_DEFINE_ENUM_INTERNAL(atan2f_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2f_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt, Flt)
-
-/// long double atan2l_finite(long double y, long double x);
-TLI_DEFINE_ENUM_INTERNAL(atan2l_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2l_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl, LDbl)
-
-/// double __atanh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(atanh_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __atanhf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(atanhf_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanhf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __atanhl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(atanhl_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanhl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// void __atomic_load(size_t size, void *mptr, void *vptr, int smodel);
-TLI_DEFINE_ENUM_INTERNAL(atomic_load)
-TLI_DEFINE_STRING_INTERNAL("__atomic_load")
-TLI_DEFINE_SIG_INTERNAL(Void, SizeT, Ptr, Ptr, Int)
-
-/// void __atomic_store(size_t size, void *mptr, void *vptr, int smodel);
-TLI_DEFINE_ENUM_INTERNAL(atomic_store)
-TLI_DEFINE_STRING_INTERNAL("__atomic_store")
-TLI_DEFINE_SIG_INTERNAL(Void, SizeT, Ptr, Ptr, Int)
-
-/// double __cosh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(cosh_finite)
-TLI_DEFINE_STRING_INTERNAL("__cosh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __coshf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(coshf_finite)
-TLI_DEFINE_STRING_INTERNAL("__coshf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __coshl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(coshl_finite)
-TLI_DEFINE_STRING_INTERNAL("__coshl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double __cospi(double x);
-TLI_DEFINE_ENUM_INTERNAL(cospi)
-TLI_DEFINE_STRING_INTERNAL("__cospi")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __cospif(float x);
-TLI_DEF...
[truncated]
|
|
@llvm/pr-subscribers-tablegen Author: Kai Nacke (redstar) ChangesThe 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 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. Patch is 178.90 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/165009.diff 19 Files Affected:
diff --git a/llvm/include/llvm/Analysis/CMakeLists.txt b/llvm/include/llvm/Analysis/CMakeLists.txt
new file mode 100644
index 0000000000000..036f7ff00ce86
--- /dev/null
+++ b/llvm/include/llvm/Analysis/CMakeLists.txt
@@ -0,0 +1,3 @@
+set(LLVM_TARGET_DEFINITIONS TargetLibraryInfo.td)
+tablegen(LLVM TargetLibraryInfo.inc -gen-target-library-info)
+add_public_tablegen_target(analysis_gen)
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
deleted file mode 100644
index 014988299d37f..0000000000000
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def
+++ /dev/null
@@ -1,2698 +0,0 @@
-//===-- TargetLibraryInfo.def - Library information -------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This .def file will either fill in the enum definition or fill in the
-// string representation array definition for TargetLibraryInfo.
-// Which is defined depends on whether TLI_DEFINE_ENUM is defined or
-// TLI_DEFINE_STRING is defined. Only one should be defined at a time.
-
-// NOTE: The nofree attribute is added to Libfuncs which are not
-// listed as free or realloc functions in MemoryBuiltins.cpp
-//
-// When adding a function which frees memory include the LibFunc
-// in lib/Analysis/MemoryBuiltins.cpp "isLibFreeFunction".
-//
-// When adding a LibFunc which reallocates memory include the LibFunc
-// in lib/Analysis/MemoryBuiltins.cpp "AllocationFnData[]".
-
-#if (defined(TLI_DEFINE_ENUM) + \
- defined(TLI_DEFINE_STRING) + \
- defined(TLI_DEFINE_SIG) != 1)
-#error "Must define exactly one of TLI_DEFINE_ENUM, TLI_DEFINE_STRING, or TLI_DEFINE_SIG for TLI .def."
-#else
-// Exactly one of TLI_DEFINE_ENUM/STRING/SIG is defined.
-
-#if defined(TLI_DEFINE_ENUM)
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant) LibFunc_##enum_variant,
-#define TLI_DEFINE_STRING_INTERNAL(string_repr)
-#define TLI_DEFINE_SIG_INTERNAL(...)
-#elif defined(TLI_DEFINE_STRING)
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant)
-#define TLI_DEFINE_STRING_INTERNAL(string_repr) string_repr,
-#define TLI_DEFINE_SIG_INTERNAL(...)
-#else
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant)
-#define TLI_DEFINE_STRING_INTERNAL(string_repr)
-#define TLI_DEFINE_SIG_INTERNAL(...) { __VA_ARGS__ },
-#endif
-
-/// void *operator new(unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_int)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new(unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_int_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPAXIABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new(unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_longlong)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong)
-
-/// void *operator new(unsigned long long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_longlong_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPEAX_KAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong, Ptr)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAXABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32_int)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAXAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64_longlong)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, LLong)
-
-/// void *operator new[](unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_int)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new[](unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_int_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPAXIABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new[](unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_longlong)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong)
-
-/// void *operator new[](unsigned long long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_longlong_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPEAX_KAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong, Ptr)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAXABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32_int)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAXAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64_longlong)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, LLong)
-
-/// int _IO_getc(_IO_FILE * __fp);
-TLI_DEFINE_ENUM_INTERNAL(under_IO_getc)
-TLI_DEFINE_STRING_INTERNAL("_IO_getc")
-TLI_DEFINE_SIG_INTERNAL(Int, Ptr)
-
-/// int _IO_putc(int __c, _IO_FILE * __fp);
-TLI_DEFINE_ENUM_INTERNAL(under_IO_putc)
-TLI_DEFINE_STRING_INTERNAL("_IO_putc")
-TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPv)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPv")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus)
-
-/// void operator delete[](void*, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus, Ptr)
-
-/// void operator delete[](void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvj)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvj")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete[](void*, unsigned int, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int, Int)
-
-/// void operator delete[](void*, unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvm)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvm")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long)
-
-/// void operator delete[](void*, unsigned long, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long, Long)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPv)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPv")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus)
-
-/// void operator delete(void*, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus, Ptr)
-
-/// void operator delete(void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvj)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvj")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete(void*, unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int, Int)
-
-/// void operator delete(void*, unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvm)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvm")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long)
-
-/// void operator delete(void*, unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long, Long)
-
-/// void *operator new[](unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(Znaj)
-TLI_DEFINE_STRING_INTERNAL("_Znaj")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new[](unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnajRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new[](unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnajSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int)
-
-/// void *operator new[](unsigned int, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnajSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int, Ptr)
-
-/// void *operator new[](unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(Znam)
-TLI_DEFINE_STRING_INTERNAL("_Znam")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long)
-
-/// void *operator new[](unsigned long, __hot_cold_t)
-/// Currently this and other operator new interfaces that take a __hot_cold_t
-/// hint are supported by the open source version of tcmalloc, see:
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h
-/// and for the definition of the __hot_cold_t parameter see:
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h
-TLI_DEFINE_ENUM_INTERNAL(Znam12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_Znam12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Bool)
-
-/// void *operator new[](unsigned long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnamRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr)
-
-/// void *operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr, Bool)
-
-/// void *operator new[](unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long)
-
-/// void *operator new[](unsigned long, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Bool)
-
-/// void *operator new[](unsigned long, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr)
-
-/// void *operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr, Bool)
-
-/// void *operator new(unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(Znwj)
-TLI_DEFINE_STRING_INTERNAL("_Znwj")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new(unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnwjRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new(unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int)
-
-/// void *operator new(unsigned int, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnwjSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int, Ptr)
-
-/// void *operator new(unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(Znwm)
-TLI_DEFINE_STRING_INTERNAL("_Znwm")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long)
-
-/// void *operator new(unsigned long, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(Znwm12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_Znwm12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Bool)
-
-/// void *operator new(unsigned long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnwmRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr)
-
-/// void *operator new(unsigned long, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr, Bool)
-
-/// void *operator new(unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long)
-
-/// void *operator new(unsigned long, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Bool)
-
-/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr)
-
-/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr, Bool)
-
-/// The following are variants of operator new which return the actual size
-/// reserved by the allocator proposed in P0901R5 (Size feedback in operator new).
-/// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0901r5.html
-/// They are implemented by tcmalloc, see source at
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h
-
-/// __sized_ptr_t __size_returning_new(size_t size)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_hot_cold(size_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_hot_cold)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_hot_cold")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_aligned)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_aligned")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_aligned_hot_cold)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_aligned_hot_cold")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// double __acos_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(acos_finite)
-TLI_DEFINE_STRING_INTERNAL("__acos_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __acosf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(acosf_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// double __acosh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(acosh_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __acoshf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(acoshf_finite)
-TLI_DEFINE_STRING_INTERNAL("__acoshf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __acoshl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(acoshl_finite)
-TLI_DEFINE_STRING_INTERNAL("__acoshl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// long double __acosl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(acosl_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double __asin_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(asin_finite)
-TLI_DEFINE_STRING_INTERNAL("__asin_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __asinf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(asinf_finite)
-TLI_DEFINE_STRING_INTERNAL("__asinf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __asinl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(asinl_finite)
-TLI_DEFINE_STRING_INTERNAL("__asinl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double atan2_finite(double y, double x);
-TLI_DEFINE_ENUM_INTERNAL(atan2_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl, Dbl)
-
-/// float atan2f_finite(float y, float x);
-TLI_DEFINE_ENUM_INTERNAL(atan2f_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2f_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt, Flt)
-
-/// long double atan2l_finite(long double y, long double x);
-TLI_DEFINE_ENUM_INTERNAL(atan2l_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2l_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl, LDbl)
-
-/// double __atanh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(atanh_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __atanhf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(atanhf_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanhf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __atanhl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(atanhl_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanhl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// void __atomic_load(size_t size, void *mptr, void *vptr, int smodel);
-TLI_DEFINE_ENUM_INTERNAL(atomic_load)
-TLI_DEFINE_STRING_INTERNAL("__atomic_load")
-TLI_DEFINE_SIG_INTERNAL(Void, SizeT, Ptr, Ptr, Int)
-
-/// void __atomic_store(size_t size, void *mptr, void *vptr, int smodel);
-TLI_DEFINE_ENUM_INTERNAL(atomic_store)
-TLI_DEFINE_STRING_INTERNAL("__atomic_store")
-TLI_DEFINE_SIG_INTERNAL(Void, SizeT, Ptr, Ptr, Int)
-
-/// double __cosh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(cosh_finite)
-TLI_DEFINE_STRING_INTERNAL("__cosh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __coshf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(coshf_finite)
-TLI_DEFINE_STRING_INTERNAL("__coshf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __coshl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(coshl_finite)
-TLI_DEFINE_STRING_INTERNAL("__coshl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double __cospi(double x);
-TLI_DEFINE_ENUM_INTERNAL(cospi)
-TLI_DEFINE_STRING_INTERNAL("__cospi")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __cospif(float x);
-TLI_DEF...
[truncated]
|
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Kai Nacke (redstar) ChangesThe 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 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. Patch is 178.90 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/165009.diff 19 Files Affected:
diff --git a/llvm/include/llvm/Analysis/CMakeLists.txt b/llvm/include/llvm/Analysis/CMakeLists.txt
new file mode 100644
index 0000000000000..036f7ff00ce86
--- /dev/null
+++ b/llvm/include/llvm/Analysis/CMakeLists.txt
@@ -0,0 +1,3 @@
+set(LLVM_TARGET_DEFINITIONS TargetLibraryInfo.td)
+tablegen(LLVM TargetLibraryInfo.inc -gen-target-library-info)
+add_public_tablegen_target(analysis_gen)
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
deleted file mode 100644
index 014988299d37f..0000000000000
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def
+++ /dev/null
@@ -1,2698 +0,0 @@
-//===-- TargetLibraryInfo.def - Library information -------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This .def file will either fill in the enum definition or fill in the
-// string representation array definition for TargetLibraryInfo.
-// Which is defined depends on whether TLI_DEFINE_ENUM is defined or
-// TLI_DEFINE_STRING is defined. Only one should be defined at a time.
-
-// NOTE: The nofree attribute is added to Libfuncs which are not
-// listed as free or realloc functions in MemoryBuiltins.cpp
-//
-// When adding a function which frees memory include the LibFunc
-// in lib/Analysis/MemoryBuiltins.cpp "isLibFreeFunction".
-//
-// When adding a LibFunc which reallocates memory include the LibFunc
-// in lib/Analysis/MemoryBuiltins.cpp "AllocationFnData[]".
-
-#if (defined(TLI_DEFINE_ENUM) + \
- defined(TLI_DEFINE_STRING) + \
- defined(TLI_DEFINE_SIG) != 1)
-#error "Must define exactly one of TLI_DEFINE_ENUM, TLI_DEFINE_STRING, or TLI_DEFINE_SIG for TLI .def."
-#else
-// Exactly one of TLI_DEFINE_ENUM/STRING/SIG is defined.
-
-#if defined(TLI_DEFINE_ENUM)
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant) LibFunc_##enum_variant,
-#define TLI_DEFINE_STRING_INTERNAL(string_repr)
-#define TLI_DEFINE_SIG_INTERNAL(...)
-#elif defined(TLI_DEFINE_STRING)
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant)
-#define TLI_DEFINE_STRING_INTERNAL(string_repr) string_repr,
-#define TLI_DEFINE_SIG_INTERNAL(...)
-#else
-#define TLI_DEFINE_ENUM_INTERNAL(enum_variant)
-#define TLI_DEFINE_STRING_INTERNAL(string_repr)
-#define TLI_DEFINE_SIG_INTERNAL(...) { __VA_ARGS__ },
-#endif
-
-/// void *operator new(unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_int)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new(unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_int_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPAXIABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new(unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_longlong)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong)
-
-/// void *operator new(unsigned long long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_longlong_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??2@YAPEAX_KAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong, Ptr)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAXABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr32_int)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAXAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_ptr64_longlong)
-TLI_DEFINE_STRING_INTERNAL("??3@YAXPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, LLong)
-
-/// void *operator new[](unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_int)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new[](unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_int_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPAXIABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new[](unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_longlong)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong)
-
-/// void *operator new[](unsigned long long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_new_array_longlong_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_U@YAPEAX_KAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Ptr, LLong, Ptr)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAXABUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr32_int)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPAXI@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAX@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64_nothrow)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAXAEBUnothrow_t@std@@@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, unsigned long long);
-TLI_DEFINE_ENUM_INTERNAL(msvc_delete_array_ptr64_longlong)
-TLI_DEFINE_STRING_INTERNAL("??_V@YAXPEAX_K@Z")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, LLong)
-
-/// int _IO_getc(_IO_FILE * __fp);
-TLI_DEFINE_ENUM_INTERNAL(under_IO_getc)
-TLI_DEFINE_STRING_INTERNAL("_IO_getc")
-TLI_DEFINE_SIG_INTERNAL(Int, Ptr)
-
-/// int _IO_putc(int __c, _IO_FILE * __fp);
-TLI_DEFINE_ENUM_INTERNAL(under_IO_putc)
-TLI_DEFINE_STRING_INTERNAL("_IO_putc")
-TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
-
-/// void operator delete[](void*);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPv)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPv")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete[](void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete[](void*, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus)
-
-/// void operator delete[](void*, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus, Ptr)
-
-/// void operator delete[](void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvj)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvj")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete[](void*, unsigned int, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int, Int)
-
-/// void operator delete[](void*, unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvm)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvm")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long)
-
-/// void operator delete[](void*, unsigned long, std::align_val_t);
-TLI_DEFINE_ENUM_INTERNAL(ZdaPvmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdaPvmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long, Long)
-
-/// void operator delete(void*);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPv)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPv")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr)
-
-/// void operator delete(void*, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr)
-
-/// void operator delete(void*, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus)
-
-/// void operator delete(void*, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, IntPlus, Ptr)
-
-/// void operator delete(void*, unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvj)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvj")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int)
-
-/// void operator delete(void*, unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Int, Int)
-
-/// void operator delete(void*, unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvm)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvm")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long)
-
-/// void operator delete(void*, unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZdlPvmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZdlPvmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Long, Long)
-
-/// void *operator new[](unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(Znaj)
-TLI_DEFINE_STRING_INTERNAL("_Znaj")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new[](unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnajRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new[](unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnajSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int)
-
-/// void *operator new[](unsigned int, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnajSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnajSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int, Ptr)
-
-/// void *operator new[](unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(Znam)
-TLI_DEFINE_STRING_INTERNAL("_Znam")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long)
-
-/// void *operator new[](unsigned long, __hot_cold_t)
-/// Currently this and other operator new interfaces that take a __hot_cold_t
-/// hint are supported by the open source version of tcmalloc, see:
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h
-/// and for the definition of the __hot_cold_t parameter see:
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h
-TLI_DEFINE_ENUM_INTERNAL(Znam12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_Znam12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Bool)
-
-/// void *operator new[](unsigned long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnamRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr)
-
-/// void *operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr, Bool)
-
-/// void *operator new[](unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long)
-
-/// void *operator new[](unsigned long, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Bool)
-
-/// void *operator new[](unsigned long, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr)
-
-/// void *operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr, Bool)
-
-/// void *operator new(unsigned int);
-TLI_DEFINE_ENUM_INTERNAL(Znwj)
-TLI_DEFINE_STRING_INTERNAL("_Znwj")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int)
-
-/// void *operator new(unsigned int, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnwjRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Ptr)
-
-/// void *operator new(unsigned int, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwjSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int)
-
-/// void *operator new(unsigned int, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnwjSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwjSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Int, Int, Ptr)
-
-/// void *operator new(unsigned long);
-TLI_DEFINE_ENUM_INTERNAL(Znwm)
-TLI_DEFINE_STRING_INTERNAL("_Znwm")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long)
-
-/// void *operator new(unsigned long, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(Znwm12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_Znwm12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Bool)
-
-/// void *operator new(unsigned long, const std::nothrow_t&);
-TLI_DEFINE_ENUM_INTERNAL(ZnwmRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr)
-
-/// void *operator new(unsigned long, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Ptr, Bool)
-
-/// void *operator new(unsigned long, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long)
-
-/// void *operator new(unsigned long, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Bool)
-
-/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_tRKSt9nothrow_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_tRKSt9nothrow_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr)
-
-/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t)
-TLI_DEFINE_STRING_INTERNAL("_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t")
-TLI_DEFINE_SIG_INTERNAL(Ptr, Long, Long, Ptr, Bool)
-
-/// The following are variants of operator new which return the actual size
-/// reserved by the allocator proposed in P0901R5 (Size feedback in operator new).
-/// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0901r5.html
-/// They are implemented by tcmalloc, see source at
-/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h
-
-/// __sized_ptr_t __size_returning_new(size_t size)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_hot_cold(size_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_hot_cold)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_hot_cold")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_aligned)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_aligned")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t, __hot_cold_t)
-TLI_DEFINE_ENUM_INTERNAL(size_returning_new_aligned_hot_cold)
-TLI_DEFINE_STRING_INTERNAL("__size_returning_new_aligned_hot_cold")
-TLI_DEFINE_SIG_INTERNAL(/* Checked manually. */)
-
-/// double __acos_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(acos_finite)
-TLI_DEFINE_STRING_INTERNAL("__acos_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __acosf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(acosf_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// double __acosh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(acosh_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __acoshf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(acoshf_finite)
-TLI_DEFINE_STRING_INTERNAL("__acoshf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __acoshl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(acoshl_finite)
-TLI_DEFINE_STRING_INTERNAL("__acoshl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// long double __acosl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(acosl_finite)
-TLI_DEFINE_STRING_INTERNAL("__acosl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double __asin_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(asin_finite)
-TLI_DEFINE_STRING_INTERNAL("__asin_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __asinf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(asinf_finite)
-TLI_DEFINE_STRING_INTERNAL("__asinf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __asinl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(asinl_finite)
-TLI_DEFINE_STRING_INTERNAL("__asinl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double atan2_finite(double y, double x);
-TLI_DEFINE_ENUM_INTERNAL(atan2_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl, Dbl)
-
-/// float atan2f_finite(float y, float x);
-TLI_DEFINE_ENUM_INTERNAL(atan2f_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2f_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt, Flt)
-
-/// long double atan2l_finite(long double y, long double x);
-TLI_DEFINE_ENUM_INTERNAL(atan2l_finite)
-TLI_DEFINE_STRING_INTERNAL("__atan2l_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl, LDbl)
-
-/// double __atanh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(atanh_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __atanhf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(atanhf_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanhf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __atanhl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(atanhl_finite)
-TLI_DEFINE_STRING_INTERNAL("__atanhl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// void __atomic_load(size_t size, void *mptr, void *vptr, int smodel);
-TLI_DEFINE_ENUM_INTERNAL(atomic_load)
-TLI_DEFINE_STRING_INTERNAL("__atomic_load")
-TLI_DEFINE_SIG_INTERNAL(Void, SizeT, Ptr, Ptr, Int)
-
-/// void __atomic_store(size_t size, void *mptr, void *vptr, int smodel);
-TLI_DEFINE_ENUM_INTERNAL(atomic_store)
-TLI_DEFINE_STRING_INTERNAL("__atomic_store")
-TLI_DEFINE_SIG_INTERNAL(Void, SizeT, Ptr, Ptr, Int)
-
-/// double __cosh_finite(double x);
-TLI_DEFINE_ENUM_INTERNAL(cosh_finite)
-TLI_DEFINE_STRING_INTERNAL("__cosh_finite")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __coshf_finite(float x);
-TLI_DEFINE_ENUM_INTERNAL(coshf_finite)
-TLI_DEFINE_STRING_INTERNAL("__coshf_finite")
-TLI_DEFINE_SIG_INTERNAL(Flt, Flt)
-
-/// long double __coshl_finite(long double x);
-TLI_DEFINE_ENUM_INTERNAL(coshl_finite)
-TLI_DEFINE_STRING_INTERNAL("__coshl_finite")
-TLI_DEFINE_SIG_INTERNAL(LDbl, LDbl)
-
-/// double __cospi(double x);
-TLI_DEFINE_ENUM_INTERNAL(cospi)
-TLI_DEFINE_STRING_INTERNAL("__cospi")
-TLI_DEFINE_SIG_INTERNAL(Dbl, Dbl)
-
-/// float __cospif(float x);
-TLI_DEF...
[truncated]
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
Thanks for doing this! I am working towards turning RuntimeLibcallsInfo into TargetLibraryInfo, to eventually replace it. Is it straightforward to port these type signatures to add them to RuntimeLibcallImpls? |
| /// that must be used. | ||
| void setAvailableWithName(LibFunc F, StringRef Name) { | ||
| if (StandardNames[F] != Name) { | ||
| if (StandardNamesStrTable.getCString(StandardNamesOffsets[F]) != Name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to include the string lengths and void the strlen cost here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
| return StringRef(); | ||
| if (State == TargetLibraryInfoImpl::StandardName) | ||
| return Impl->StandardNames[F]; | ||
| return Impl->StandardNamesStrTable.getCString( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
| def msvc_new_int : TargetLibCall< "??2@YAPAXI@Z", [Ptr, Int]>; | ||
|
|
||
| /// void *operator new(unsigned int, const std::nothrow_t&); | ||
| def msvc_new_int_nothrow : TargetLibCall< "??2@YAPAXIABUnothrow_t@std@@@Z", [Ptr, Int, Ptr]>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reflow this to avoid breaking the type list across lines? Also note that I'd consider clang-format's tablegen handling to be wrong 95% of the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each def is currently a single long line without line breaks, due to my migration.
I'll separate the return type and the argument types, and then reflow the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reformatted the file. The return type and argument type list are all on the same line.
|
|
||
|
|
||
| // Definition of library function. | ||
| class TargetLibCall<string Str, list<FuncArgType> Sig> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should separate the argument and return values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature list is now split into return type and argument types. I used ? as return type to denote manually type checking, which is used for a couple of functions.
It should be easy to extract the signatures, and mix them into RuntimeLibcallsInfo. (I assume it is mostly pattern matching. I used a couple of sed expressions to go from .def to .td.) Of course, there are lot of functions in RuntimeLibcallsInfo which are not in TargetLibraryInfo, requiring manual effort to add a type signature (if needed). |
A couple of functions are checked manually. Those are marked by using the unspecified value for the return type.
- the space after `<` is gone now - the return type/argument type list are all on 1 line - some fixes to multi-line comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Thank-you for the improvement!
Just a general comment. It would be nice if you can add some documentation for the various functions in TargetLibraryInfoEmitter.cpp so it's easier to understand for newbies to table gen.
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 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.