8000 Globally enable /Os during PGInstrument · python/cpython@04300ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 04300ec

Browse files
committed
Globally enable /Os during PGInstrument
1 parent 2dbb2e0 commit 04300ec

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

PCbuild/pyproject.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
<PreprocessorDefinitions Condition="'$(DisableGil)' == 'true'">Py_NOGIL=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
4444
<PreprocessorDefinitions Condition="'$(SupportPGO)' and ($(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate')">_Py_USING_PGO=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
4545

46-
<Optimization>MaxSpeed</Optimization>
46+
<Optimization Condition="$(Configuration) == 'PGInstrument'">MinSpace</Optimization>
47+
<Optimization Condition="$(Configuration) != 'PGInstrument'">MaxSpeed</Optimization>
4748
<IntrinsicFunctions>true</IntrinsicFunctions>
4849
<StringPooling>true</StringPooling>
4950
<ExceptionHandling></ExceptionHandling>

Python/ceval.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,6 @@ extern const struct _PyCode_DEF(8) _Py_InitCleanup;
664664
* so consume 3 units of C stack */
665665
#define PY_EVAL_C_STACK_UNITS 2
666666

667-
#if defined(_MSC_VER) && defined(_Py_USING_PGO)
668-
/* gh-111786: _PyEval_EvalFrameDefault is too large to optimize for speed with
669-
PGO on MSVC. Disable that optimization temporarily. If this is fixed
670-
upstream, we should gate this on the version of MSVC.
671-
*/
672-
# pragma optimize("t", off)
673-
/* This setting is reversed below following _PyEval_EvalFrameDefault */
674-
#endif
675-
676667
PyObject* _Py_HOT_FUNCTION
677668
_PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
678669
{
@@ -1087,7 +1078,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10871078
# pragma GCC diagnostic pop
10881079
#elif defined(_MSC_VER) /* MS_WINDOWS */
10891080
# pragma warning(pop)
1090-
# pragma optimize("", on)
10911081
#endif
10921082

10931083
static void

0 commit comments

Comments
 (0)
0