8000 GH-115457: Support splitting and replication of micro ops. by markshannon · Pull Request #115558 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-115457: Support splitting and replication of micro ops. #115558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into split-on-oparg-1
  • Loading branch information
markshannon committed Feb 15, 2024
commit 9ec72e51a68857804e30963528b30df83e8d26d5
7 changes: 4 additions & 3 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

190 changes: 96 additions & 94 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Tools/cases_generator/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Properties:
uses_co_names: bool
uses_locals: bool
has_free: bool
side_exit: bool
pure: bool
passthrough: bool
oparg_and_1: bool = False
Expand Down
16 changes: 16 additions & 0 deletions Tools/cases_generator/tier2_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ def tier2_replace_deopt(
out.emit(") goto deoptimize;\n")


def tier2_replace_exit_if(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
uop: Uop,
unused: Stack,
inst: Instruction | None,
) -> None:
out.emit_at("if ", tkn)
out.emit(next(tkn_iter))
emit_to(out, tkn_iter, "RPAREN")
next(tkn_iter) # Semi colon
out.emit(") goto side_exit;\n")


def tier2_replace_oparg(
out: CWriter,
tkn: Token,
Expand All @@ -128,6 +143,7 @@ def tier2_replace_oparg(
TIER2_REPLACEMENT_FUNCTIONS["ERROR_IF"] = tier2_replace_error
TIER2_REPLACEMENT_FUNCTIONS["DEOPT_IF"] = tier2_replace_deopt
TIER2_REPLACEMENT_FUNCTIONS["oparg"] = tier2_replace_oparg
TIER2_REPLACEMENT_FUNCTIONS["EXIT_IF"] = tier2_replace_exit_if


def write_uop(uop: Uop, out: CWriter, stack: Stack) -> None:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0