Skip to content

gh-129987: Selectively re-enable SLP autovectorization of _PyEval_EvalFrameDefault #132530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,11 +948,15 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
#include "generated_cases.c.h"
#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
* dispatch, negating any benefit we get from vectorization elsewhere in the
* interpreter loop.
* gh-129987: The SLP autovectorizer can cause poor code generation for
* opcode dispatch in some GCC versions (observed in GCCs 12 through 15,
* 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")))
#else
Expand Down
Loading