Skip to content

Commit

Permalink
gh-118335: Make REGEN_JIT_COMMAND empty if tier2 interpreter enabled (#…
Browse files Browse the repository at this point in the history
…118493)

Also patch up news blurb for gh-118339
(add warning that PYTHON_UOPS is now PYTHON_JIT).
  • Loading branch information
gvanrossum committed May 1, 2024
1 parent 97feb4a commit a524152
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
Expand Up @@ -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.
24 changes: 15 additions & 9 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions configure.ac
Expand Up @@ -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"])
Expand All @@ -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])
Expand Down

0 comments on commit a524152

Please sign in to comment.