Skip to content

[mypyc] Misc improvements to ll_builder helpers#20722

Merged
JukkaL merged 1 commit intomasterfrom
mypyc-irbuild-tweaks
Feb 2, 2026
Merged

[mypyc] Misc improvements to ll_builder helpers#20722
JukkaL merged 1 commit intomasterfrom
mypyc-irbuild-tweaks

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Feb 2, 2026

These were extracted from a branch that adds vec type support to mypyc. I'm splitting the branch into multiple PRs to make reviewing easier. Add some simple IR generation helpers, add more coercions between fixed-width integer types, and add a helper for generating IR for simple for loops.

These were extracted from a branch that adds vec type support to mypyc.
I'm splitting the branch into multiple PRs to make reviewing easier.
Comment on lines +2949 to +2954
for_loop = builder.begin_for(start_ptr, end_ptr, int32_rprimitive.size)

# For loop body
builder.set_mem(for_loop.index, int32_rprimitive, Integer(0, int32_rprimitive))

for_loop.finish()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it would be more convenient to change ForBuilder into a context manager.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look at this later after I've merged the whole mypyc vec support branch.

@JukkaL JukkaL merged commit bf7fe09 into master Feb 2, 2026
16 checks passed
@JukkaL JukkaL deleted the mypyc-irbuild-tweaks branch February 2, 2026 14:58
@cdce8p
Copy link
Collaborator

cdce8p commented Feb 3, 2026

This PR seems to have broken the windows builds.

building '2dc1e0389069ba707e56__mypyc' extension
creating build\temp.win-amd64-cpython-314\Release\build
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\a\mypy_mypyc-wheels\mypy_mypyc-wheels\mypy\mypyc\lib-rt -Ibuild -IC:\Users\runneradmin\AppData\Local\Temp\build-env-3i7vzaet\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.14.2\tools\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.14.2\tools\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcbuild\__native_2dc1e0389069ba707e56.c /Fobuild\temp.win-amd64-cpython-314\Release\build\__native_2dc1e0389069ba707e56.obj /O2 /DEBUG:NONE /wd4102 /wd4101 /wd4146 /GL- /wd9025
cl : Command line warning D9025 : overriding '/GL' with '/GL-'
cl : Command line warning D9014 : invalid value '9025' for '/wd'; assuming '5999'
__native_2dc1e0389069ba707e56.c
D:\a\mypy_mypyc-wheels\mypy_mypyc-wheels\mypy\build\__native_2dc1e0389069ba707e56.h(11642): error C2059: syntax error: '__leave'
D:\a\mypy_mypyc-wheels\mypy_mypyc-wheels\mypy\build\__native_2dc1e0389069ba707e56.h(11643): error C2059: syntax error: '}'
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

https://github.com/mypyc/mypy_mypyc-wheels/actions
https://github.com/mypyc/mypy_mypyc-wheels/actions/runs/21595085392/job/62225253667#step:4:4414

JukkaL added a commit that referenced this pull request Feb 3, 2026
The `leave` attribute appears to cause a conflict with reserved C
names in Windows.  A better fix would be to fix name generation in
mypyc, but this quick fix hopefully unblocks mypyc wheel builds.

Context:
#20722 (comment)
@JukkaL
Copy link
Collaborator Author

JukkaL commented Feb 3, 2026

Hopefully this fixes the wheel builds: #20730

JukkaL added a commit that referenced this pull request Feb 3, 2026
The `leave` attribute appears to cause a conflict with reserved C names
in Windows. A better fix would be to fix name generation in mypyc, but
this quick fix hopefully unblocks mypyc wheel builds.

Context:
#20722 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants