Skip to content
Snippets Groups Projects
Commit 9a5cf8cf authored by Anh Nguyen-Tuong's avatar Anh Nguyen-Tuong
Browse files

Fix error in graph optimization

parent 110324e2
No related branches found
No related tags found
No related merge requests found
......@@ -598,6 +598,16 @@ BasicBlockSet_t ZaxBase_t::getBlocksToInstrument(const ControlFlowGraph_t &cfg)
if (m_bb_graph_optimize)
{
const auto has_unique_preds=
[&](const BasicBlockSet_t& bbs) -> bool
{
for (const auto & b : bbs)
{
if (b->getPredecessors().size() != 1)
return false;
}
return true;
};
const auto has_ibta=
[&](const BasicBlockSet_t& successors) -> bool
{
......@@ -611,6 +621,7 @@ BasicBlockSet_t ZaxBase_t::getBlocksToInstrument(const ControlFlowGraph_t &cfg)
if (bb->getSuccessors().size() == 2 &&
bb->endsInConditionalBranch() &&
has_unique_preds(bb->getSuccessors()) &&
!has_ibta(bb->getSuccessors()))
{
// for now, until we get a more principled way of pruning the graph,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment