| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…nerator. Use it to support efficient specializations of COPY and SWAP in the JIT.
|
Can you call the PR something else instead of "scalar replacement"? Scalar replacement is the other term for escape analysis in the JVM https://devblogs.microsoft.com/java/improving-openjdk-scalar-replacement-part-1-3/ I know CS has a lot of overlapping terms, but I think it would be clearer to call it "change replicates to ranges" or something. |
Sorry, something went wrong.
|
scalarize works too. |
Sorry, something went wrong.
| ] + items[index+1:] | ||
|
|
||
| def scalarize_stack(stack: StackEffect, oparg: int) -> StackEffect: | ||
| # Only scalarize if no more than one input or output is array |
There was a problem hiding this comment.
This comment doesn't seem to belong to this code segment?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I refactored the code but didn't move the comment.
Sorry, something went wrong.
|
This is scalar replacement. We are replacing a composite object (an array in this case) with a set of scalar values. In the JVM, that means breaking down an object into its parts. The JVM version is a lot more complex and powerful, but it is doing the same thing, and the motivation is the same: register allocation. |
Sorry, something went wrong.
It's somewhat confusing because it's scalar replacement in the JIT, but not in the default interpreter. Though you subtly implied it with the "uops". |
Sorry, something went wrong.
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
| index = -1 | ||
| for i, item in enumerate(items): | ||
| if "oparg" in item.size: | ||
| if index >= 0: | ||
| return items | ||
| index = i | ||
| if index < 0: | ||
| return items |
There was a problem hiding this comment.
This entire part is somewhat confusing, but I'll let it slide since there's a comment up top :).
Sorry, something went wrong.
…ps in the JIT code generator. (pythonGH-135563) * Use it to support efficient specializations of COPY and SWAP in the JIT.
…ps in the JIT code generator. (pythonGH-135563) * Use it to support efficient specializations of COPY and SWAP in the JIT.
…ps in the JIT code generator. (pythonGH-135563) * Use it to support efficient specializations of COPY and SWAP in the JIT.
…ps in the JIT code generator. (pythonGH-135563) * Use it to support efficient specializations of COPY and SWAP in the JIT.
| Back | FazBrowse Home | New Git URL |
This PR does three things:
With TOS caching this should allow COPY and SWAP to be implemented as register-to-register moves.