Mesa (master): i965/fs: Add debugging to constant combining pass.

Matt Turner mattst88 at kemper.freedesktop.org
Wed Jan 13 18:33:29 UTC 2016


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Thu Feb 26 16:06:45 2015 -0800

i965/fs: Add debugging to constant combining pass.

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

---

 .../drivers/dri/i965/brw_fs_combine_constants.cpp  |   21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp b/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
index c5280ac..9141907 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_combine_constants.cpp
@@ -39,6 +39,8 @@
 
 using namespace brw;
 
+static const bool debug = false;
+
 /* Returns whether an instruction could co-issue if its immediate source were
  * replaced with a GRF source.
  */
@@ -265,7 +267,6 @@ fs_visitor::opt_combine_constants()
    if (cfg->num_blocks != 1)
       qsort(table.imm, table.len, sizeof(struct imm), compare);
 
-
    /* Insert MOVs to load the constant values into GRFs. */
    fs_reg reg(VGRF, alloc.allocate(dispatch_width / 8));
    reg.stride = 0;
@@ -303,6 +304,24 @@ fs_visitor::opt_combine_constants()
       }
    }
 
+   if (debug) {
+      for (int i = 0; i < table.len; i++) {
+         struct imm *imm = &table.imm[i];
+
+         printf("%.3fF - block %3d, reg %3d sub %2d, Uses: (%2d, %2d), "
+                "IP: %4d to %4d, length %4d\n",
+                imm->val,
+                imm->block->num,
+                imm->nr,
+                imm->subreg_offset,
+                imm->must_promote,
+                imm->uses_by_coissue,
+                imm->first_use_ip,
+                imm->last_use_ip,
+                imm->last_use_ip - imm->first_use_ip);
+      }
+   }
+
    ralloc_free(const_ctx);
    invalidate_live_intervals();
 




More information about the mesa-commit mailing list