mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
nir/cf: Make a helper function for removing a predecessor.
I need to do this in a second place, and I'd rather make a helper function than cut and paste the code. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
6a67ede6b3
commit
e2637db618
1 changed files with 11 additions and 5 deletions
|
|
@ -60,6 +60,16 @@ block_add_pred(nir_block *block, nir_block *pred)
|
|||
_mesa_set_add(block->predecessors, pred);
|
||||
}
|
||||
|
||||
static inline void
|
||||
block_remove_pred(nir_block *block, nir_block *pred)
|
||||
{
|
||||
struct set_entry *entry = _mesa_set_search(block->predecessors, pred);
|
||||
|
||||
assert(entry);
|
||||
|
||||
_mesa_set_remove(block->predecessors, entry);
|
||||
}
|
||||
|
||||
static void
|
||||
link_blocks(nir_block *pred, nir_block *succ1, nir_block *succ2)
|
||||
{
|
||||
|
|
@ -83,11 +93,7 @@ unlink_blocks(nir_block *pred, nir_block *succ)
|
|||
pred->successors[1] = NULL;
|
||||
}
|
||||
|
||||
struct set_entry *entry = _mesa_set_search(succ->predecessors, pred);
|
||||
|
||||
assert(entry);
|
||||
|
||||
_mesa_set_remove(succ->predecessors, entry);
|
||||
block_remove_pred(succ, pred);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue