i965/fs: Show register pressure in dump_instructions() output.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 5 Aug 2013 06:34:01 +0000 (23:34 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 21 Jan 2014 22:20:44 +0000 (14:20 -0800)
Dumping the number of live registers at each IP allows us to see
register pressure and identify any local maxima.  This should
aid in debugging passes designed to reduce register pressure, as
well as optimizations that suddenly trigger spilling.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_shader.h

index 4766a8a119779db2cabd3649d45df94034093741..181a9393b8c43280566fe0a4e0b6df3e4c4b4942 100644 (file)
@@ -2941,6 +2941,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)
 {
index f064886cead826752a7beff3fdf04449bae926fb..f493784012b86f0c58cbf901d67320ae42f8fc6d 100644 (file)
@@ -432,6 +432,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);
index ff5af932e087fdb3a520a1710ac102dfc8d44f41..936a2070dc05095243e785e324b8440a18cc3c23 100644 (file)
@@ -86,7 +86,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);