]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
jit: Drop redundant LLVM configure probes.
authorThomas Munro <tmunro@postgresql.org>
Tue, 30 Dec 2025 03:39:19 +0000 (16:39 +1300)
committerThomas Munro <tmunro@postgresql.org>
Tue, 30 Dec 2025 07:24:42 +0000 (20:24 +1300)
We currently require LLVM 14, so these probes for LLVM 9 functions
always succeeded.  Even when the features aren't enabled in an LLVM
build, dummy functions are defined (a problem for a later commit).

The whole PGAC_CHECK_LLVM_FUNCTIONS macro and Meson equivalent are
removed, because we switched to testing LLVM_VERSION_MAJOR at compile
time in subsequent work and these were the last holdouts.  That suits
the nature of LLVM API evolution better, and also allows for strictly
mechanical pruning in future commits like 820b5af7 and 972c2cd2.  They
advanced the minimum LLVM version but failed to spot these.

Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CA%2BhUKGJgB6gvrdDohgwLfCwzVQm%3DVMtb9m0vzQn%3DCwWn-kwG9w%40mail.gmail.com

config/llvm.m4
configure
configure.ac
meson.build
src/backend/jit/llvm/llvmjit.c
src/include/pg_config.h.in

index 9d6fe8199e364e3b5c0c52ab2281ddf2bf1eae6c..5d4f14cb90060594acd60d8959323ac156ea8cdd 100644 (file)
@@ -101,20 +101,3 @@ dnl LLVM_CONFIG, CLANG are already output via AC_ARG_VAR
   AC_SUBST(LLVM_BINPATH)
 
 ])# PGAC_LLVM_SUPPORT
-
-
-# PGAC_CHECK_LLVM_FUNCTIONS
-# -------------------------
-#
-# Check presence of some optional LLVM functions.
-# (This shouldn't happen until we're ready to run AC_CHECK_DECLS tests;
-# because PGAC_LLVM_SUPPORT runs very early, it's not an appropriate place.)
-#
-AC_DEFUN([PGAC_CHECK_LLVM_FUNCTIONS],
-[
-  # Check which functionality is present
-  SAVE_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
-  AC_CHECK_DECLS([LLVMCreateGDBRegistrationListener, LLVMCreatePerfJITEventListener], [], [], [[#include <llvm-c/ExecutionEngine.h>]])
-  CPPFLAGS="$SAVE_CPPFLAGS"
-])# PGAC_CHECK_LLVM_FUNCTIONS
index 14ad0a5006fa47897bbdb18fdf8e63064bbb63e7..f203f9d528b432c5a9a289833c51eee9a137f258 100755 (executable)
--- a/configure
+++ b/configure
   CPPFLAGS=$ac_save_CPPFLAGS
 fi
 
-if test "$with_llvm" = yes; then
-
-  # Check which functionality is present
-  SAVE_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
-  ac_fn_c_check_decl "$LINENO" "LLVMCreateGDBRegistrationListener" "ac_cv_have_decl_LLVMCreateGDBRegistrationListener" "#include <llvm-c/ExecutionEngine.h>
-"
-if test "x$ac_cv_have_decl_LLVMCreateGDBRegistrationListener" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "LLVMCreatePerfJITEventListener" "ac_cv_have_decl_LLVMCreatePerfJITEventListener" "#include <llvm-c/ExecutionEngine.h>
-"
-if test "x$ac_cv_have_decl_LLVMCreatePerfJITEventListener" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER $ac_have_decl
-_ACEOF
-
-  CPPFLAGS="$SAVE_CPPFLAGS"
-
-fi
-
 # Lastly, restore full LIBS list and check for readline/libedit symbols
 LIBS="$LIBS_including_readline"
 
index 01b3bbc1be82a8fdfb5cb94c65aa424f59fba04f..ec38ddefa36a706408d1f4cbc8da41f7da6982df 100644 (file)
@@ -1941,10 +1941,6 @@ if test "$with_icu" = yes; then
   CPPFLAGS=$ac_save_CPPFLAGS
 fi
 
-if test "$with_llvm" = yes; then
-  PGAC_CHECK_LLVM_FUNCTIONS()
-fi
-
 # Lastly, restore full LIBS list and check for readline/libedit symbols
 LIBS="$LIBS_including_readline"
 
index d7c5193d4cee45a1f6862752f4d0bc4d49774464..ec08cd49056119ae15c9bd97f8512c364d31bc09 100644 (file)
@@ -2679,14 +2679,6 @@ decl_checks += [
   ['memset_s', 'string.h', '#define __STDC_WANT_LIB_EXT1__ 1'],
 ]
 
-# Check presence of some optional LLVM functions.
-if llvm.found()
-  decl_checks += [
-    ['LLVMCreateGDBRegistrationListener', 'llvm-c/ExecutionEngine.h'],
-    ['LLVMCreatePerfJITEventListener', 'llvm-c/ExecutionEngine.h'],
-  ]
-endif
-
 foreach c : decl_checks
   func = c.get(0)
   header = c.get(1)
index 15c3475ede2f9d34cb9dae63f7e18218f4120732..9b599d1138054a5374bc0cacc583d7ea622416ed 100644 (file)
@@ -1180,24 +1180,19 @@ llvm_create_object_layer(void *Ctx, LLVMOrcExecutionSessionRef ES, const char *T
                LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(ES);
 #endif
 
-
-#if defined(HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER) && HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER
        if (jit_debugging_support)
        {
                LLVMJITEventListenerRef l = LLVMCreateGDBRegistrationListener();
 
                LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(objlayer, l);
        }
-#endif
 
-#if defined(HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER) && HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER
        if (jit_profiling_support)
        {
                LLVMJITEventListenerRef l = LLVMCreatePerfJITEventListener();
 
                LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(objlayer, l);
        }
-#endif
 
        return objlayer;
 }
index 92fcc5f30639b52fdefc50b86003197788d9436e..f0091b09cbead1cbb3a92b1a6876e95cd48d9704 100644 (file)
    don't. */
 #undef HAVE_DECL_F_FULLFSYNC
 
-/* Define to 1 if you have the declaration of
-   `LLVMCreateGDBRegistrationListener', and to 0 if you don't. */
-#undef HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER
-
-/* Define to 1 if you have the declaration of
-   `LLVMCreatePerfJITEventListener', and to 0 if you don't. */
-#undef HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER
-
 /* Define to 1 if you have the declaration of `memset_s', and to 0 if you
    don't. */
 #undef HAVE_DECL_MEMSET_S