Uh oh!
There was an error while loading. Please reload this page.
GH-128914: Remove all but one conditional stack effects - #129226
Conversation
markshannon
commented
Jan 23, 2025
Note: Prior to this change, monitored calls would see With this PR, monitored calls will see |
markshannon
commented
Jan 23, 2025
Performance for free-threading is about 1% slower, mostly attributable to the Richards benchmarks. Which suggests to me that the change to |
markshannon
commented
Jan 24, 2025
I needed to effectively revert the change to |
Performance is neutral on the default build. Free-threading shows a 1% slowdown which makes no sense given the stats and code changes. |
bedevere-bot
commented
Jan 27, 2025
|
Conditional stack effects fall into three categories:
NULLifoparg & 1_PyObject_GetMethodifoparg & 1This PR:
_PUSH_NULL_CONDIITONALthat pushesNULLifoparg & 1and uses it in all instructions that pushed NULL conditionally, so that those ops no longer have conditional stack effects.LOAD_ATTRto useself_of_null[oparg & 1] instead ofself_or_null if (oparg & 1)`. This has no meaningful change on the generated code, so no impact on the interpreter. It will force the JIT to spill any registers, but we expect all jitted code to be specialized anyway.BUILD_SLICEto use an array of args. GiveCALL_FUNCTION_EXhas a fixed stack effect by and pushingNULLin the compiler when**kwargsis not defined.A future PR will remove support for conditional stack effects and the
splitannotation.