nir: Add a nir_after_instr_and_phis helper
authorJesse Natalie <jenatali@microsoft.com>
Mon, 8 Mar 2021 22:15:05 +0000 (14:15 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Mar 2021 01:41:32 +0000 (01:41 +0000)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9464>

src/compiler/nir/nir.h

index acb6877..4145a34 100644 (file)
@@ -3770,6 +3770,15 @@ nir_after_phis(nir_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)
 {
    if (node->type == nir_cf_node_block)