Inline ordinary jumps to small blocks and jumps to terminating control flow.

This commit is contained in:
Daniel Kirchner
2021-03-24 13:50:24 +01:00
committed by hrkrshnn
parent a99eb17608
commit 8b3095920a
17 changed files with 79 additions and 56 deletions
+21
View File
@@ -1637,6 +1637,27 @@ BOOST_AUTO_TEST_CASE(inliner_cse_break)
);
}
BOOST_AUTO_TEST_CASE(inliner_stop)
{
AssemblyItem jumpTo{Instruction::JUMP};
AssemblyItems items{
AssemblyItem(PushTag, 1),
Instruction::JUMP,
AssemblyItem(Tag, 1),
Instruction::STOP
};
AssemblyItems expectation{
Instruction::STOP,
AssemblyItem(Tag, 1),
Instruction::STOP
};
Inliner{items, {}, 200, false, {}}.optimise();
BOOST_CHECK_EQUAL_COLLECTIONS(
items.begin(), items.end(),
expectation.begin(), expectation.end()
);
}
BOOST_AUTO_TEST_SUITE_END()
} // end namespaces