mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-129987: Selectively re-enable SLP autovectorization of _PyEval_EvalFrameDefault (#132530)
Only disable SLP autovectorization of `_PyEval_EvalFrameDefault` on newer GCCs, as the optimization bug seems to exist only on GCC 12 and later, and before GCC 9 disabling the optimization has a dramatic performance impact.
This commit is contained in:
parent
0879ebc953
commit
c66ffcf8e3
1 changed files with 8 additions and 4 deletions
|
@ -948,11 +948,15 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
|
||||||
#include "generated_cases.c.h"
|
#include "generated_cases.c.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(__GNUC__) && !defined(__clang__)) && defined(__x86_64__)
|
#if (defined(__GNUC__) && __GNUC__ >= 10 && !defined(__clang__)) && defined(__x86_64__)
|
||||||
/*
|
/*
|
||||||
* gh-129987: The SLP autovectorizer can cause poor code generation for opcode
|
* gh-129987: The SLP autovectorizer can cause poor code generation for
|
||||||
* dispatch, negating any benefit we get from vectorization elsewhere in the
|
* opcode dispatch in some GCC versions (observed in GCCs 12 through 15,
|
||||||
* interpreter loop.
|
* probably caused by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115777),
|
||||||
|
* negating any benefit we get from vectorization elsewhere in the
|
||||||
|
* interpreter loop. Disabling it significantly affected older GCC versions
|
||||||
|
* (prior to GCC 9, 40% performance drop), so we have to selectively disable
|
||||||
|
* it.
|
||||||
*/
|
*/
|
||||||
#define DONT_SLP_VECTORIZE __attribute__((optimize ("no-tree-slp-vectorize")))
|
#define DONT_SLP_VECTORIZE __attribute__((optimize ("no-tree-slp-vectorize")))
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue