Skip to content

[3.14] gh-148284: Block inlining of gigantic functions in ceval.c for clang 22#148326

Open
Fidget-Spinner wants to merge 2 commits intopython:3.14from
Fidget-Spinner:block_inlining_of_gigantic_functions
Open

[3.14] gh-148284: Block inlining of gigantic functions in ceval.c for clang 22#148326
Fidget-Spinner wants to merge 2 commits intopython:3.14from
Fidget-Spinner:block_inlining_of_gigantic_functions

Conversation

@Fidget-Spinner
Copy link
Copy Markdown
Member

@Fidget-Spinner Fidget-Spinner commented Apr 10, 2026

It seems that on clang-22, the inliner is too aggressive on _PyEval_EvalFrameDefault when on computed goto interpreter. Together with some strange interaction with the stackref buffer, the function requires 40kB of stack space (!!!) versus the usual 1-2kB normally used.

This sets the inline limit to functions of max 512B stack space (1/4th of normal) allowed to be inlined in ceval.c. I checked the dissasembly and the new function uses about 2kB of stack.

This will need a forward-port to 3.15 too.

@Fidget-Spinner Fidget-Spinner changed the title [3.14] gh-148284: Block inlining of gigantic functions in ceval.c [3.14] gh-148284: Block inlining of gigantic functions in ceval.c for clang 22 Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant