]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118335: Make REGEN_JIT_COMMAND empty if tier2 interpreter enabled (#118493)
authorGuido van Rossum <guido@python.org>
Wed, 1 May 2024 23:36:29 +0000 (16:36 -0700)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 23:36:29 +0000 (16:36 -0700)
Also patch up news blurb for gh-118339
(add warning that PYTHON_UOPS is now PYTHON_JIT).

Misc/NEWS.d/next/Core and Builtins/2024-04-26-14-06-18.gh-issue-118335.SRFsxO.rst
configure
configure.ac

index e13edbbbe528eb217744df382f43872855882951..54295a75c02e855f864839181e7d1acef490e330 100644 (file)
@@ -2,3 +2,6 @@ Change how to use the tier 2 interpreter. Instead of running Python with
 ``-X uops`` or setting the environment variable ``PYTHON_UOPS=1``, this
 choice is now made at build time by configuring with
 ``--enable-experimental-jit=interpreter``.
+
+**Beware!** This changes the environment variable to enable or disable
+micro-ops to ``PYTHON_JIT``. The old ``PYTHON_UOPS`` is no longer used.
index 24e7396e389fd1ee49d9d9ca59c9d498565b2e99..cc85aed2aa51c2f4fb89d3dcbaf91313abe4bfc1 100755 (executable)
--- a/configure
+++ b/configure
@@ -8235,18 +8235,24 @@ else $as_nop
 fi
 
 case $enable_experimental_jit in
-  no) enable_experimental_jit=no ;;
-  yes) enable_experimental_jit="-D_Py_JIT -D_Py_TIER2=1" ;;
-  yes-off) enable_experimental_jit="-D_Py_JIT -D_Py_TIER2=3" ;;
-  interpreter) enable_experimental_jit="-D_Py_TIER2=4" ;;
-  interpreter-off) enable_experimental_jit="-D_Py_TIER2=6" ;;  # Secret option
+  no)              jit_flags="";          tier2_flags="" ;;
+  yes)             jit_flags="-D_Py_JIT"; tier2_flags="-D_Py_TIER2=1" ;;
+  yes-off)         jit_flags="-D_Py_JIT"; tier2_flags="-D_Py_TIER2=3" ;;
+  interpreter)     jit_flags="";          tier2_flags="-D_Py_TIER2=4" ;;
+  interpreter-off) jit_flags="";          tier2_flags="-D_Py_TIER2=6" ;;  # Secret option
   *) as_fn_error $? "invalid argument: --enable-experimental-jit=$enable_experimental_jit; expected no|yes|yes-off|interpreter" "$LINENO" 5 ;;
 esac
-if test "x$enable_experimental_jit" = xno
+if ${tier2_flags:+false} :
 then :
 
 else $as_nop
-  as_fn_append CFLAGS_NODIST " $enable_experimental_jit"
+  as_fn_append CFLAGS_NODIST " $tier2_flags"
+fi
+if ${jit_flags:+false} :
+then :
+
+else $as_nop
+  as_fn_append CFLAGS_NODIST " $jit_flags"
            REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"
            JIT_STENCILS_H="jit_stencils.h"
            if test "x$Py_DEBUG" = xtrue
@@ -8256,8 +8262,8 @@ fi
 fi
 
 
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_experimental_jit" >&5
-printf "%s\n" "$enable_experimental_jit" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tier2_flags $jit_flags" >&5
+printf "%s\n" "$tier2_flags $jit_flags" >&6; }
 
 # Enable optimization flags
 
index 0f1177872d9137263b32d19f4c4c26e0f2f715fd..c55e33add20fdecef1f85fb905c9a7ff2fcb3746 100644 (file)
@@ -1776,18 +1776,22 @@ AC_ARG_ENABLE([experimental-jit],
               [],
               [enable_experimental_jit=no])
 case $enable_experimental_jit in
-  no) enable_experimental_jit=no ;;
-  yes) enable_experimental_jit="-D_Py_JIT -D_Py_TIER2=1" ;;
-  yes-off) enable_experimental_jit="-D_Py_JIT -D_Py_TIER2=3" ;;
-  interpreter) enable_experimental_jit="-D_Py_TIER2=4" ;;
-  interpreter-off) enable_experimental_jit="-D_Py_TIER2=6" ;;  # Secret option
+  no)              jit_flags="";          tier2_flags="" ;;
+  yes)             jit_flags="-D_Py_JIT"; tier2_flags="-D_Py_TIER2=1" ;;
+  yes-off)         jit_flags="-D_Py_JIT"; tier2_flags="-D_Py_TIER2=3" ;;
+  interpreter)     jit_flags="";          tier2_flags="-D_Py_TIER2=4" ;;
+  interpreter-off) jit_flags="";          tier2_flags="-D_Py_TIER2=6" ;;  # Secret option
   *) AC_MSG_ERROR(
       [invalid argument: --enable-experimental-jit=$enable_experimental_jit; expected no|yes|yes-off|interpreter]) ;;
 esac
-AS_VAR_IF([enable_experimental_jit],
-          [no],
+AS_VAR_IF([tier2_flags],
           [],
-          [AS_VAR_APPEND([CFLAGS_NODIST], [" $enable_experimental_jit"])
+          [],
+          [AS_VAR_APPEND([CFLAGS_NODIST], [" $tier2_flags"])])
+AS_VAR_IF([jit_flags],
+          [],
+          [],
+          [AS_VAR_APPEND([CFLAGS_NODIST], [" $jit_flags"])
            AS_VAR_SET([REGEN_JIT_COMMAND],
                       ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"])
            AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
@@ -1797,7 +1801,7 @@ AS_VAR_IF([enable_experimental_jit],
                      [])])
 AC_SUBST([REGEN_JIT_COMMAND])
 AC_SUBST([JIT_STENCILS_H])
-AC_MSG_RESULT([$enable_experimental_jit])
+AC_MSG_RESULT([$tier2_flags $jit_flags])
 
 # Enable optimization flags
 AC_SUBST([DEF_MAKE_ALL_RULE])