Mesa (master): i965: Re-index SSA definitions before printing NIR code.

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Jun 12 00:00:18 UTC 2015


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jun 10 01:46:13 2015 -0700

i965: Re-index SSA definitions before printing NIR code.

This makes the SSA definitions use sequential numbers (0, 1, 2, ...)
instead of seemingly random ones.  There's not much point normally,
but it makes debug output much easier to read.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_nir.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 142162c..c13708a 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -167,6 +167,12 @@ brw_create_nir(struct brw_context *brw,
    nir_validate_shader(nir);
 
    if (unlikely(debug_enabled)) {
+      /* Re-index SSA defs so we print more sensible numbers. */
+      nir_foreach_overload(nir, overload) {
+         if (overload->impl)
+            nir_index_ssa_defs(overload->impl);
+      }
+
       fprintf(stderr, "NIR (SSA form) for %s shader:\n",
               _mesa_shader_stage_to_string(stage));
       nir_print_shader(nir, stderr);




More information about the mesa-commit mailing list