Uh oh!
There was an error while loading. Please reload this page.
gh-134584: Specialize POP_TOP by reference and type in JIT - #135761
Conversation
markshannon
left a comment
There was a problem hiding this comment.
Very nice.
You can streamline the optimization a bit using sym_is_immortal and you might want to add a test for optimizing the POP_TOP after a call that returns None.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…nner/cpython into eliminate_store_fast_refcount
| JitOptRef temp = retval; | ||
| // We wrap and unwrap the value to mimic PyStackRef_MakeHeapSafe | ||
| // in bytecodes.c | ||
| JitOptRef temp = PyJitRef_Wrap(PyJitRef_Unwrap(retval)); |
There was a problem hiding this comment.
This was a bug in the previous implementation. This was only exposed in this PR.
| if (sym->tag == JIT_SYM_KNOWN_CLASS_TAG) { | ||
| return sym->cls.type == &PyBool_Type; | ||
| } | ||
| if (sym->tag == JIT_SYM_TRUTHINESS_TAG) { |
There was a problem hiding this comment.
A truthiness is not immortal. This is a false asumption.
Uh oh!
There was an error while loading. Please reload this page.
markshannon
left a comment
There was a problem hiding this comment.
Looks good.
This should wait for TOS caching, otherwise it is adding overhead to STORE_FAST. But once that is in, this makes a nice improvement.
Uh oh!
There was an error while loading. Please reload this page.