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-135904: Optimize the JIT's assembly control flow by brandtbucher · Pull Request #135905 · python/cpython Conversation
|
| _re_return: typing.ClassVar[re.Pattern[str]] = _RE_NEVER_MATCH | ||
|
|
||
| def __post_init__(self) -> None: | ||
| # Split the code into a linked list of basic blocks. A basic block is an |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
So I'm trying to reason about what happens if we miss something, say a branch instruction that we did not include in our branch table?
Or is everything in the x64 spec already included in the table above?
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.
If we miss it, it won't be optimised and I don't think it will break the logic anyway.
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.
Everything is already included (but one was misspelled, thanks for making me double-check).
If we miss one, we will accidentally create a superblock instead of a basic block, and will miss one outgoing edge. This could cause _invert_hot_branches to miscount the number of predecessors for the jump after the branch, and perform an invalid optimization. It could also make our hot-cold splitting incorrect.
So bad things could happen, but those would just be bugs that need fixing.
(Not detecting any branches is a special case, since _invert_hot_branches will never run, so everything is fine. That's why AArch64 works fine now, even though we haven't taught its optimizer about branches yet.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| class _Block: | ||
| label: str | None = None | ||
| # Non-instruction lines like labels, directives, and comments: | ||
| noise: list[str] = dataclasses.field(default_factory=list) |
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.
We have already discuss this, but can we find a better name for this? Noise implies something irrelevant or random data that can be discarded, eliminated or filtered out. We don't do this here, on the contrary we include all these lines otherwise we end up with a broken file.
I would vote for something like:
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.
I've renamed to noninstructions.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is great BTW, I love it. |
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.
Thanks for addressing the comments. It looks good to me.
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.
Nice! This is super cool. Just one small comment, not blocking.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # was required to disable them. | ||
| "-mno-outline-atomics", | ||
| ] | ||
| # -mno-outline-atomics: Keep intrinsics from being emitted. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does this still only apply to aarch64 Linux? Just curious why we dropped the platform specificity in the comment?
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, it's in the branch "aarch64-.*-linux-gnu" and the previous comment was just saying that :)
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.
Yeah, it just seemed redundant given the surrounding context!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.