[Mesa-dev] [PATCH 15/16] i965: Dump the register pressure!

Matt Turner mattst88 at gmail.com
Thu Dec 19 13:40:29 PST 2013


From: Kenneth Graunke <kenneth at whitecape.org>

---
 src/mesa/drivers/dri/i965/brw_fs.cpp   | 14 ++++++++++++++
 src/mesa/drivers/dri/i965/brw_fs.h     |  1 +
 src/mesa/drivers/dri/i965/brw_shader.h |  2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 2c7b3ae..606e21a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2943,6 +2943,20 @@ fs_visitor::lower_uniform_pull_constant_loads()
 }
 
 void
+fs_visitor::dump_instructions()
+{
+   calculate_register_pressure();
+
+   int ip = 0;
+   foreach_list(node, &this->instructions) {
+      backend_instruction *inst = (backend_instruction *)node;
+      printf("{%3d} %4d: ", regs_live_at_ip[ip], ip);
+      dump_instruction(inst);
+      ++ip;
+   }
+}
+
+void
 fs_visitor::dump_instruction(backend_instruction *be_inst)
 {
    fs_inst *inst = (fs_inst *)be_inst;
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index bee8cdf..75c5c97 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -431,6 +431,7 @@ public:
    void setup_builtin_uniform_values(ir_variable *ir);
    int implied_mrf_writes(fs_inst *inst);
 
+   virtual void dump_instructions();
    void dump_instruction(backend_instruction *inst);
 
    void visit_atomic_counter_intrinsic(ir_call *ir);
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
index bc994e0..c76f33b 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -87,7 +87,7 @@ public:
    exec_list instructions;
 
    virtual void dump_instruction(backend_instruction *inst) = 0;
-   void dump_instructions();
+   virtual void dump_instructions();
 
    void assign_common_binding_table_offsets(uint32_t next_binding_table_offset);
 
-- 
1.8.3.2



More information about the mesa-dev mailing list