Skip to content

Instantly share code, notes, and snippets.

/-

Created May 19, 2017 15:11
Show Gist options
  • Save anonymous/0ea199c7ff6ea13d6d4d56315bcf3317 to your computer and use it in GitHub Desktop.
Save anonymous/0ea199c7ff6ea13d6d4d56315bcf3317 to your computer and use it in GitHub Desktop.
static void
compute_dominance_frontiers_1 (bitmap_head *frontiers)
{
edge p;
edge_iterator ei;
basic_block b;
FOR_EACH_BB_FN (b, cfun)
{
if (EDGE_COUNT (b->preds) >= 2)
{
FOR_EACH_EDGE (p, ei, b->preds)
{
basic_block runner = p->src;
basic_block domsb;
if (runner == ENTRY_BLOCK_PTR_FOR_FN (cfun))
continue;
domsb = get_immediate_dominator (CDI_DOMINATORS, b);
while (runner != domsb)
{
if (!bitmap_set_bit (&frontiers[runner->index],
b->index))
break;
runner = get_immediate_dominator (CDI_DOMINATORS,
runner);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment