From 71a13ea90d0d718ae4a070c0f954dd8980740ec1 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 23 Jan 2025 12:56:42 -0500 Subject: [PATCH 1/2] Remove compiler workaround --- Python/ceval.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index 58a54467f06bb0..158be16e15d3a3 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -766,23 +766,6 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch) #define PY_EVAL_C_STACK_UNITS 2 -/* _PyEval_EvalFrameDefault is too large to optimize for speed with PGO on MSVC - when the JIT is enabled or GIL is disabled. Disable that optimization around - this function only. If this is fixed upstream, we should gate this on the - version of MSVC. - */ -#if (defined(_MSC_VER) && \ - defined(_Py_USING_PGO) && \ - (defined(_Py_JIT) || \ - defined(Py_GIL_DISABLED))) -#define DO_NOT_OPTIMIZE_INTERP_LOOP -#endif - -#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP -# pragma optimize("t", off) -/* This setting is reversed below following _PyEval_EvalFrameDefault */ -#endif - PyObject* _Py_HOT_FUNCTION _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag) { @@ -1178,10 +1161,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int } -#ifdef DO_NOT_OPTIMIZE_INTERP_LOOP -# pragma optimize("", on) -#endif - #if defined(__GNUC__) # pragma GCC diagnostic pop #elif defined(_MSC_VER) /* MS_WINDOWS */ From 7758ccf8f96ca3e9a18e772f2fbcf9f733fc969c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 24 Jan 2025 14:09:39 -0500 Subject: [PATCH 2/2] Remote _Py_USING_PGO --- PCbuild/pyproject.props | 1 - 1 file changed, 1 deletion(-) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 17abfa85201a90..dbdb6b743bea37 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -53,7 +53,6 @@ $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)Include\internal\mimalloc;$(GeneratedPyConfigDir);$(PySourcePath)PC;%(AdditionalIncludeDirectories) WIN32;$(_Py3NamePreprocessorDefinition);$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PyStatsPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) - _Py_USING_PGO=1;%(PreprocessorDefinitions) MaxSpeed true