nir/cf: add remove_phi_src() helper

Signed-off-by: Connor Abbott <connor.w.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Connor Abbott 2015-07-21 19:54:21 -07:00 committed by Kenneth Graunke
parent f41e108d8b
commit 13482111d0
1 changed files with 17 additions and 0 deletions

View File

@ -373,6 +373,23 @@ nir_handle_add_jump(nir_block *block)
}
}
static void
remove_phi_src(nir_block *block, nir_block *pred)
{
nir_foreach_instr(block, instr) {
if (instr->type != nir_instr_type_phi)
break;
nir_phi_instr *phi = nir_instr_as_phi(instr);
nir_foreach_phi_src_safe(phi, src) {
if (src->pred == pred) {
list_del(&src->src.use_link);
exec_node_remove(&src->node);
}
}
}
}
void
nir_handle_remove_jump(nir_block *block, nir_jump_type type)
{