Mesa (master): nir: Add a nir_after_instr_and_phis helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 9 02:17:17 UTC 2021


Module: Mesa
Branch: master
Commit: ef0d2a5b4b93699afc5c9eaec2917630465f8455
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef0d2a5b4b93699afc5c9eaec2917630465f8455

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Mar  8 14:15:05 2021 -0800

nir: Add a nir_after_instr_and_phis helper

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9464>

---

 src/compiler/nir/nir.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index acb6877d242..4145a345212 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -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)
 {



More information about the mesa-commit mailing list