nir: Add a nir_after_instr_and_phis helper

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9464>
This commit is contained in:
Jesse Natalie 2021-03-08 14:15:05 -08:00 committed by Marge Bot
parent 25020c125a
commit ef0d2a5b4b

View file

@ -3769,6 +3769,15 @@ nir_after_phis(nir_block *block)
return nir_after_block(block);
}
static inline nir_cursor
nir_after_instr_and_phis(nir_instr *instr)
{
if (instr->type == nir_instr_type_phi)
return nir_after_phis(instr->block);
else
return nir_after_instr(instr);
}
static inline nir_cursor
nir_after_cf_node_and_phis(nir_cf_node *node)
{