From f228a06dbe965b9f332115c94d305855687a6c80 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 29 Apr 2024 20:25:10 -0700 Subject: [PATCH] Rip out --enable-experimental-tier2, in favor of --enable-experimental-jit=XXX There's more to do. --- Include/Python.h | 2 +- configure | 32 ++++++-------------------------- configure.ac | 22 +++++++--------------- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/Include/Python.h b/Include/Python.h index 3e9f7d07e8251d..9ece592db92197 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -53,7 +53,7 @@ // The JIT depends on TIER2 #ifdef _Py_JIT -#define _Py_TIER2 1 +#define _Py_TIER2 _Py_JIT #endif // Include Python header files diff --git a/configure b/configure index 2f3ab35e99652c..caca9e85758bf9 100755 --- a/configure +++ b/configure @@ -1089,7 +1089,6 @@ with_trace_refs enable_pystats with_assertions enable_experimental_jit -enable_experimental_tier2 enable_optimizations with_lto enable_bolt @@ -1819,12 +1818,9 @@ Optional Features: --disable-gil enable experimental support for running without the GIL (default is no) --enable-pystats enable internal statistics gathering (default is no) - --enable-experimental-jit + --enable-experimental-jit[=no|yes|yes-default-off|interpreter] build the experimental just-in-time compiler (default is no) - --enable-experimental-tier2 - use the experimental tier 2 interpreter (default is - no) --enable-optimizations enable expensive, stable optimizations (PGO, etc.) (default is no) --enable-bolt enable usage of the llvm-bolt post-link optimizer @@ -8230,11 +8226,15 @@ else $as_nop enable_experimental_jit=no fi +case $enable_experimental_jit in + no|yes|yes-default-off|interpreter) ;; + *) as_fn_error $? "invalid argument: --enable-experimental-jit=$enable_experimental_jit; expected no|yes|yes-default-off|interpreter" "$LINENO" 5 ;; +esac if test "x$enable_experimental_jit" = xno then : else $as_nop - as_fn_append CFLAGS_NODIST " -D_Py_JIT" + as_fn_append CFLAGS_NODIST " -D_Py_JIT=_PY_JIT_$(echo $enable_experimental_jit | tr a-z- A-Z_)" REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host" JIT_STENCILS_H="jit_stencils.h" if test "x$Py_DEBUG" = xtrue @@ -8247,26 +8247,6 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_experimental_jit" >&5 printf "%s\n" "$enable_experimental_jit" >&6; } -# Check for --enable-experimental-tier2: -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-experimental-tier2" >&5 -printf %s "checking for --enable-experimental-tier2... " >&6; } -# Check whether --enable-experimental-tier2 was given. -if test ${enable_experimental_tier2+y} -then : - enableval=$enable_experimental_tier2; -else $as_nop - enable_experimental_tier2=no -fi - -if test "x$enable_experimental_tier2" = xno -then : - -else $as_nop - as_fn_append CFLAGS_NODIST " -D_Py_TIER2" -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_experimental_tier2" >&5 -printf "%s\n" "$enable_experimental_tier2" >&6; } - # Enable optimization flags diff --git a/configure.ac b/configure.ac index 835cd14e0a8d7f..c13566d3d617d4 100644 --- a/configure.ac +++ b/configure.ac @@ -1765,14 +1765,19 @@ fi # Check for --enable-experimental-jit: AC_MSG_CHECKING([for --enable-experimental-jit]) AC_ARG_ENABLE([experimental-jit], - [AS_HELP_STRING([--enable-experimental-jit], + [AS_HELP_STRING([--enable-experimental-jit@<:@=no|yes|yes-default-off|interpreter@:>@], [build the experimental just-in-time compiler (default is no)])], [], [enable_experimental_jit=no]) +case $enable_experimental_jit in + no|yes|yes-default-off|interpreter) ;; + *) AC_MSG_ERROR( + [invalid argument: --enable-experimental-jit=$enable_experimental_jit; expected no|yes|yes-default-off|interpreter]) ;; +esac AS_VAR_IF([enable_experimental_jit], [no], [], - [AS_VAR_APPEND([CFLAGS_NODIST], [" -D_Py_JIT"]) + [AS_VAR_APPEND([CFLAGS_NODIST], [" -D_Py_JIT=_PY_JIT_$(echo $enable_experimental_jit | tr a-z- A-Z_)"]) AS_VAR_SET([REGEN_JIT_COMMAND], ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"]) AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"]) @@ -1784,19 +1789,6 @@ AC_SUBST([REGEN_JIT_COMMAND]) AC_SUBST([JIT_STENCILS_H]) AC_MSG_RESULT([$enable_experimental_jit]) -# Check for --enable-experimental-tier2: -AC_MSG_CHECKING([for --enable-experimental-tier2]) -AC_ARG_ENABLE([experimental-tier2], - [AS_HELP_STRING([--enable-experimental-tier2], - [use the experimental tier 2 interpreter (default is no)])], - [], - [enable_experimental_tier2=no]) -AS_VAR_IF([enable_experimental_tier2], - [no], - [], - [AS_VAR_APPEND([CFLAGS_NODIST], [" -D_Py_TIER2"])]) -AC_MSG_RESULT([$enable_experimental_tier2]) - # Enable optimization flags AC_SUBST([DEF_MAKE_ALL_RULE]) AC_SUBST([DEF_MAKE_RULE])