GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — GH-135379: Support limited scalar replacement for replicated uops in the JIT code generator. by markshannon · Pull Request #135563 · python/cpython Conversation
|
|
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.
There was an error while loading. Please reload this page.
|
scalarize works too. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ] + 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.
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't seem to belong to this code segment?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, I refactored the code but didn't move the comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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.
There was an error while loading. Please reload this page.
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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Ken Jin <[email protected]>
| 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.
The reason will be displayed to describe this comment to others. Learn more.
This entire part is somewhat confusing, but I'll let it slide since there's a comment up top :).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…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.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.