10000 gh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations by iritkatriel · Pull Request #114530 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations #114530

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 9 commits into from
Jan 25, 2024
Prev Previous commit
Next Next commit
convert in main loop
  • Loading branch information
iritkatriel committed Jan 25, 2024
commit 111fc78806d35a60402f0136928a966760be8fee
9 changes: 1 addition & 8 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ label_exception_targets(basicblock *entryblock) {
}
else if (instr->i_opcode == POP_BLOCK) {
handler = pop_except_block(except_stack);
INSTR_SET_OP0(instr, NOP);
}
else if (is_jump(instr)) {
instr->i_except = handler;
Expand Down Expand Up @@ -954,14 +955,6 @@ label_exception_targets(basicblock *entryblock) {
}
}

for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
for (int i = 0; i < b->b_iused; i++) {
cfg_instr *instr = &b->b_instr[i];
if (instr->i_opcode == POP_BLOCK) {
INSTR_SET_OP0(instr, NOP);
}
}
}
#ifdef Py_DEBUG
for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
assert(b->b_exceptstack == NULL);
Expand Down
0