Skip to content
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

feat: LLVM multi-version adaptation #440

Merged
merged 12 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
300 changes: 300 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -7015,6 +7015,306 @@ if test x"$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" = x"yes";
BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Xclang -no-opaque-pointers, for BITCODE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Xclang -no-opaque-pointers, for BITCODE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cflags__Xclang__no_opaque_pointers+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CLANG}
CFLAGS="${BITCODE_CFLAGS} -Xclang -no-opaque-pointers"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cflags__Xclang__no_opaque_pointers=yes
else
pgac_cv_prog_CLANG_cflags__Xclang__no_opaque_pointers=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Xclang__no_opaque_pointers" >&5
$as_echo "$pgac_cv_prog_CLANG_cflags__Xclang__no_opaque_pointers" >&6; }
if test x"$pgac_cv_prog_CLANG_cflags__Xclang__no_opaque_pointers" = x"yes"; then
BITCODE_CFLAGS="${BITCODE_CFLAGS} -Xclang -no-opaque-pointers"
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -Xclang -no-opaque-pointers, for BITCODE_CXXFLAGS" >&5
$as_echo_n "checking whether ${CLANGXX} supports -Xclang -no-opaque-pointers, for BITCODE_CXXFLAGS... " >&6; }
if ${pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CXXFLAGS=$CXXFLAGS
pgac_save_CXX=$CXX
CXX=${CLANGXX}
CXXFLAGS="${BITCODE_CXXFLAGS} -Xclang -no-opaque-pointers"
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers=yes
else
pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="$pgac_save_CXXFLAGS"
CXX="$pgac_save_CXX"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers" >&5
$as_echo "$pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers" >&6; }
if test x"$pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers" = x"yes"; then
BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -Xclang -no-opaque-pointers"
fi


NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CLANG}
CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=yes
else
pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&5
$as_echo "$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" >&6; }
if test x"$pgac_cv_prog_CLANG_cflags__Wunused_command_line_argument" = x"yes"; then
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
fi

if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-unused-command-line-argument"
fi
NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CLANG}
CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=yes
else
pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&5
$as_echo "$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" >&6; }
if test x"$pgac_cv_prog_CLANG_cflags__Wcompound_token_split_by_macro" = x"yes"; then
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
fi

if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
fi
NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CLANG}
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=yes
else
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&5
$as_echo "$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&6; }
if test x"$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" = x"yes"; then
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
fi

if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
fi
NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CLANG}
CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cflags__Wformat_truncation=yes
else
pgac_cv_prog_CLANG_cflags__Wformat_truncation=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&5
$as_echo "$pgac_cv_prog_CLANG_cflags__Wformat_truncation" >&6; }
if test x"$pgac_cv_prog_CLANG_cflags__Wformat_truncation" = x"yes"; then
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
fi

if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"
fi
NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cflags__Wstringop_truncation+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CLANG}
CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cflags__Wstringop_truncation=yes
else
pgac_cv_prog_CLANG_cflags__Wstringop_truncation=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&5
$as_echo "$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" >&6; }
if test x"$pgac_cv_prog_CLANG_cflags__Wstringop_truncation" = x"yes"; then
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
fi

if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-stringop-truncation"
fi
fi

# supply -g if --enable-debug
Expand Down
29 changes: 29 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,35 @@ if test "$with_llvm" = yes ; then
PGAC_PROG_VARCXX_VARFLAGS_OPT(CLANGXX, BITCODE_CXXFLAGS, [-fwrapv])
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, BITCODE_CFLAGS, [-fexcess-precision=standard])
PGAC_PROG_VARCXX_VARFLAGS_OPT(CLANGXX, BITCODE_CXXFLAGS, [-fexcess-precision=standard])

PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, BITCODE_CFLAGS, [-Xclang -no-opaque-pointers])
PGAC_PROG_VARCXX_VARFLAGS_OPT(CLANGXX, BITCODE_CXXFLAGS, [-Xclang -no-opaque-pointers])

NOT_THE_CFLAGS=""
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wunused-command-line-argument])
if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-unused-command-line-argument"
fi
NOT_THE_CFLAGS=""
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wcompound-token-split-by-macro])
if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
fi
NOT_THE_CFLAGS=""
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
fi
NOT_THE_CFLAGS=""
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wformat-truncation])
if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"
fi
NOT_THE_CFLAGS=""
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wstringop-truncation])
if test -n "$NOT_THE_CFLAGS"; then
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-stringop-truncation"
fi
fi

# supply -g if --enable-debug
Expand Down
2 changes: 1 addition & 1 deletion doc/src/sgml/parallel.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';

<para>
In addition, the system must not be running in single-user mode. Since
the entire database system is running in single process in this situation,
the entire database system is running as a single process in this situation,
no background workers will be available.
</para>

Expand Down
2 changes: 1 addition & 1 deletion doc/src/sgml/ref/alter_table.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
constraint. This does not work, however, if any of the partition keys
is an expression and the partition does not accept
<literal>NULL</literal> values. If attaching a list partition that will
not accept <literal>NULL</literal> values, also add
not accept <literal>NULL</literal> values, also add a
<literal>NOT NULL</literal> constraint to the partition key column,
unless it's an expression.
</para>
Expand Down
6 changes: 3 additions & 3 deletions doc/src/sgml/sources.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,9 @@ BETTER: unrecognized node type: 42
<simplesect>
<title>Function-Like Macros and Inline Functions</title>
<para>
Both, macros with arguments and <literal>static inline</literal>
functions, may be used. The latter are preferable if there are
multiple-evaluation hazards when written as a macro, as e.g. the
Both macros with arguments and <literal>static inline</literal>
functions may be used. The latter are preferable if there are
multiple-evaluation hazards when written as a macro, as e.g., the
case with
<programlisting>
#define Max(x, y) ((x) > (y) ? (x) : (y))
Expand Down
2 changes: 1 addition & 1 deletion src/backend/access/common/bufmask.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mask_unused_space(Page page)
if (pd_lower > pd_upper || pd_special < pd_upper ||
pd_lower < SizeOfPageHeaderData || pd_special > BLCKSZ)
{
elog(ERROR, "invalid page pd_lower %u pd_upper %u pd_special %u\n",
elog(ERROR, "invalid page pd_lower %u pd_upper %u pd_special %u",
pd_lower, pd_upper, pd_special);
}

Expand Down
Loading