-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-139922: Tail calling for MSVC (VS 2026) #139962
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
base: main
Are you sure you want to change the base?
Changes from all commits
82d1259
3248658
9ac430d
085c1d7
0b12f2e
acf48f5
35e96c1
d7737e9
86f19cf
40013cc
48db59e
bc9d23c
19e02c2
66ec774
50f8ff7
5d908b4
0786133
e699d40
66d6c39
5584fec
7eeeaa8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Allow building CPython with the tail calling interpreter on Visual Studio 2026 MSVC. This provides a performance gain over the prior interpreter for MSVC. Patch by Ken Jin, Brandt Bucher, and Chris Eibl. With help from the MSVC team including Hulon Jenkins. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -595,7 +595,9 @@ | |
| <ClCompile Include="..\Python\bltinmodule.c" /> | ||
| <ClCompile Include="..\Python\bootstrap_hash.c" /> | ||
| <ClCompile Include="..\Python\brc.c" /> | ||
| <ClCompile Include="..\Python\ceval.c" /> | ||
| <ClCompile Include="..\Python\ceval.c"> | ||
| <AdditionalOptions Condition="'$(UseTailCallInterp)' == 'true' and $(PlatformToolset) != 'ClangCL'">/std:clatest %(AdditionalOptions)</AdditionalOptions> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if we pass this option to clang-cl? Does it break? Any possibility of passing a specific /std:c rather than "latest"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I've worked with Chris on this and apparently it builds with clang-cl still the last time I checked with him? @chris-eibl There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yupp, clang-cl doesn't like
But I assume MSVC needs
Yeah, we could explicitely enforce
Yes, it still does. Having done a lot of builds recently and still playing around. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm under the impression we need clatest for msvc musttail as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just verified again:
So atm we're stuck with this construct until MSVC introduces a new "fixed" option (or maybe accepts I agree with Steve #135927 (comment)
and we should revisit this once we know a fixed version option for it. |
||
| </ClCompile> | ||
| <ClCompile Include="..\Python\codecs.c" /> | ||
| <ClCompile Include="..\Python\codegen.c" /> | ||
| <ClCompile Include="..\Python\compile.c" /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How arbitrary is this amount? What is the usual amount of space required for conversions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to arbitrarily always consume 10 PyObject/PyStackRef per call. Meaning even if you had a single item, the whole 10 slot space would be used.