Skip to content

Commit d09e18b

Browse files
committed
Add output filter to remove spill/reload pairs
1 parent f62123f commit d09e18b

File tree

6 files changed

+51
-209
lines changed

6 files changed

+51
-209
lines changed

Lib/test/test_generated_cases.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,7 @@ def test_stack_save_reload(self):
15351535
input = """
15361536
inst(BALANCED, ( -- )) {
15371537
SAVE_STACK();
1538+
code();
15381539
RELOAD_STACK();
15391540
}
15401541
"""
@@ -1545,12 +1546,32 @@ def test_stack_save_reload(self):
15451546
next_instr += 1;
15461547
INSTRUCTION_STATS(BALANCED);
15471548
_PyFrame_SetStackPointer(frame, stack_pointer);
1549+
code();
15481550
stack_pointer = _PyFrame_GetStackPointer(frame);
15491551
DISPATCH();
15501552
}
15511553
"""
15521554
self.run_cases_test(input, output)
15531555

1556+
def test_stack_save_reload_paired(self):
1557+
1558+
input = """
1559+
inst(BALANCED, ( -- )) {
1560+
SAVE_STACK();
1561+
RELOAD_STACK();
1562+
}
1563+
"""
1564+
1565+
output = """
1566+
TARGET(BALANCED) {
1567+
frame->instr_ptr = next_instr;
1568+
next_instr += 1;
1569+
INSTRUCTION_STATS(BALANCED);
1570+
DISPATCH();
1571+
}
1572+
"""
1573+
self.run_cases_test(input, output)
1574+
15541575
def test_stack_reload_only(self):
15551576

15561577
input = """

0 commit comments

Comments
 (0)