8000 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
propagate only if false
  • Loading branch information
iritkatriel committed Jan 24, 2024
commit 63e5c9cdb85d773b58628d13f282b40e97eb2e5a
12 changes: 9 additions & 3 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,12 +1032,16 @@ basicblock_remove_redundant_nops(basicblock *bb) {
cfg_instr *next_instr = &bb->b_instr[src + 1];
int next_lineno = next_instr->i_loc.lineno;
if (next_lineno == lineno) {
next_instr->i_loc_propagated = src_instr->i_loc_propagated;
if (!src_instr->i_loc_propagated) {
next_instr->i_loc_propagated = 0;
}
continue;
}
if (next_lineno < 0) {
next_instr->i_loc = src_instr->i_loc;
next_instr->i_loc_propagated = src_instr->i_loc_propagated;
if (!src_instr->i_loc_propagated) {
next_instr->i_loc_propagated = 0;
}
continue;
}
}
Expand All @@ -1057,7 +1061,9 @@ basicblock_remove_redundant_nops(basicblock *bb) {
break;
}
if (next_instr && lineno == next_instr->i_loc.lineno) {
next_instr->i_loc_propagated = src_instr->i_loc_propagated;
if (!src_instr->i_loc_propagated) {
next_instr->i_loc_propagated = 0;
}
continue;
}
}
Expand Down
0